Class: Tweetkit::Response::Meta

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/tweetkit/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(meta) ⇒ Meta

Returns a new instance of Meta.



87
88
89
# File 'lib/tweetkit/response.rb', line 87

def initialize(meta)
  @meta = meta
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(attribute, **args) ⇒ Object



91
92
93
94
# File 'lib/tweetkit/response.rb', line 91

def method_missing(attribute, **args)
  data = meta[attribute.to_s]
  data.empty? ? super : data
end

Instance Attribute Details

#metaObject

Returns the value of attribute meta.



85
86
87
# File 'lib/tweetkit/response.rb', line 85

def meta
  @meta
end

Instance Method Details

#respond_to_missing?(method, *args) ⇒ Boolean

Returns:

  • (Boolean)


96
97
98
# File 'lib/tweetkit/response.rb', line 96

def respond_to_missing?(method, *args)
  meta.respond_to? method
end