Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/omdbapi/default.rb
Overview
Reopen the Hash class to add method.
Instance Method Summary collapse
-
#method_missing(name) ⇒ Object
Allow accessing hashes via dot notation.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object
Allow accessing hashes via dot notation.
19 20 21 22 23 |
# File 'lib/omdbapi/default.rb', line 19 def method_missing(name) return self[name] if key? name self.each { |k,v| return v if k.to_s.to_sym == name } super.method_missing name end |