Module: Dropcaster::HashKeys
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/dropcaster/hashkeys.rb', line 3 def method_missing(meth,*args) m = meth.id2name if /=$/ =~ m self[m.chop.to_sym] = (args.length < 2 ? args[0] : args) else self[m.to_sym] end end |