Sha256: 805222a32c3248bff257ddd7e386136541e76b69b1a5a217f0ff2eadaf8a8d01

Contents?: true

Size: 402 Bytes

Versions: 14

Compression:

Stored size: 402 Bytes

Contents

class TweetStream::Hash < ::Hash #:nodoc: all
  def initialize(other_hash = {})
    other_hash.keys.each do |key|
      value = other_hash[key]
      value = TweetStream::Hash.new(value) if value.is_a?(::Hash)
      self[key.to_sym] = value
    end
  end
    
  def method_missing(method_name, *args)
    if key?(method_name.to_sym)
      self[method_name.to_sym]
    else
      super
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
tweetstream-1.1.4 lib/tweetstream/hash.rb
tweetstream-1.1.3 lib/tweetstream/hash.rb
tweetstream-1.1.2 lib/tweetstream/hash.rb
tweetstream-1.1.1 lib/tweetstream/hash.rb
tweetstream-1.1.0 lib/tweetstream/hash.rb
tweetstream-1.0.5 lib/tweetstream/hash.rb
tweetstream-1.1.0.rc2 lib/tweetstream/hash.rb
tweetstream-1.1.0.rc1 lib/tweetstream/hash.rb
xh5-tweetstream-1.1.0 lib/tweetstream/hash.rb
tweetstream-1.0.4 lib/tweetstream/hash.rb
tweetstream-1.0.3 lib/tweetstream/hash.rb
tweetstream-1.0.2 lib/tweetstream/hash.rb
tweetstream-1.0.1 lib/tweetstream/hash.rb
tweetstream-1.0.0 lib/tweetstream/hash.rb