Class: ImmutableStruct
- Inherits:
-
Data
- Object
- Data
- ImmutableStruct
- Defined in:
- lib/esm/extension/immutable_struct.rb
Instance Method Summary collapse
-
#method_missing(method_name) ⇒ Object
Act like ostruct and return nil if the method isn't defined.
- #respond_to_missing?(_method_name, _include_private = false) ⇒ Boolean
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name) ⇒ Object
Act like ostruct and return nil if the method isn't defined
8 9 10 |
# File 'lib/esm/extension/immutable_struct.rb', line 8 def method_missing(method_name, *, &) send(method_name, *, &) if self.class.method_defined?(method_name) end |
Instance Method Details
#respond_to_missing?(_method_name, _include_private = false) ⇒ Boolean
12 13 14 |
# File 'lib/esm/extension/immutable_struct.rb', line 12 def respond_to_missing?(_method_name, _include_private = false) true end |