Class: GoogleCSE::Result
- Inherits:
-
Hash
- Object
- Hash
- GoogleCSE::Result
- Defined in:
- lib/google_cse/result.rb
Instance Method Summary collapse
-
#initialize(hash = {}, default = nil, &block) ⇒ Result
constructor
A new instance of Result.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize(hash = {}, default = nil, &block) ⇒ Result
Returns a new instance of Result.
3 4 5 6 |
# File 'lib/google_cse/result.rb', line 3 def initialize(hash = {}, default = nil, &block) default ? super(default) : super(&block) update(hash) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/google_cse/result.rb', line 8 def method_missing name, *args, &block if self.key?(name.to_s) self[name.to_s] else super end end |