Class: Kamaze::Project::Struct
- Defined in:
- lib/kamaze/project/struct.rb
Overview
Generic struct (alaOpenStruct
)
Instance Method Summary collapse
-
#method_missing(method, *args) ⇒ Object
Introduces some strictness on
OpenStruct#method_missing
. - #respond_to_missing?(method, include_private = false) ⇒ Boolean
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
Introduces some strictness on OpenStruct#method_missing
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/kamaze/project/struct.rb', line 19 def method_missing(method, *args) if method[-1] != '=' unless self.to_h.include?(method.to_sym) = "undefined method `#{method}' for #{self}" raise NoMethodError, , caller(1) end end super end |
Instance Method Details
#respond_to_missing?(method, include_private = false) ⇒ Boolean
31 32 33 |
# File 'lib/kamaze/project/struct.rb', line 31 def respond_to_missing?(method, include_private = false) super end |