Class: Hash
Direct Known Subclasses
Instance Method Summary collapse
-
#method_missing(symbol, *args) ⇒ Object
If a method is missing it is interpreted as the key of the hash.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args) ⇒ Object
If a method is missing it is interpreted as the key of the hash. If the method has an argument (for example by “method=”), the key called “method” is set to the respective argument.
5 6 7 8 9 10 11 |
# File 'lib/transmission-rss/core_ext/Hash.rb', line 5 def method_missing(symbol, *args) if args.size == 0 self[symbol.to_s] else self[symbol.to_s.slice 0..-2] = args.first end end |