Module: RubyApp::Mixins::HashMixin
- Included in:
- Hash
- Defined in:
- lib/ruby_app/mixins/hash_mixin.rb
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *arguments) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/ruby_app/mixins/hash_mixin.rb', line 7 def method_missing(name, *arguments) if name.to_s.match(/(.*)=/) capture = $~.captures[0] self[capture.to_sym] = arguments[0] else return self[name.to_sym] end end |