Module: RubyApp::Mixins::HashMixin
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 |
# File 'lib/ruby_app/mixins/hash_mixin.rb', line 7 def method_missing(name, *arguments) if name.to_s.match(/(.*)=/) self[$~.captures[0].to_s] = arguments[0] else self[name.to_s] || self[name.to_sym] end end |