Class: TweetStream::Hash
- Inherits:
-
Hash
- Object
- Hash
- TweetStream::Hash
- Defined in:
- lib/tweetstream/hash.rb
Overview
:nodoc: all
Instance Method Summary collapse
-
#initialize(other_hash = {}) ⇒ Hash
constructor
A new instance of Hash.
- #method_missing(method_name, *args) ⇒ Object
Constructor Details
#initialize(other_hash = {}) ⇒ Hash
Returns a new instance of Hash.
2 3 4 5 6 |
# File 'lib/tweetstream/hash.rb', line 2 def initialize(other_hash = {}) other_hash.keys.each do |key| self[key.to_sym] = other_hash[key] end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/tweetstream/hash.rb', line 8 def method_missing(method_name, *args) if key?(method_name.to_sym) self[method_name.to_sym] else super end end |