Class: Tweetkit::Response::Tweet
- Inherits:
-
Object
- Object
- Tweetkit::Response::Tweet
- Defined in:
- lib/tweetkit/response.rb
Instance Attribute Summary collapse
-
#tweet ⇒ Object
Returns the value of attribute tweet.
Instance Method Summary collapse
-
#initialize(tweet) ⇒ Tweet
constructor
A new instance of Tweet.
- #method_missing(attribute) ⇒ Object
- #respond_to_missing?(method, *args) ⇒ Boolean
Constructor Details
#initialize(tweet) ⇒ Tweet
Returns a new instance of Tweet.
136 137 138 |
# File 'lib/tweetkit/response.rb', line 136 def initialize(tweet) @tweet = tweet end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(attribute) ⇒ Object
140 141 142 143 |
# File 'lib/tweetkit/response.rb', line 140 def method_missing(attribute) data = tweet[attribute.to_s] data.empty? ? super : data end |
Instance Attribute Details
#tweet ⇒ Object
Returns the value of attribute tweet.
134 135 136 |
# File 'lib/tweetkit/response.rb', line 134 def tweet @tweet end |
Instance Method Details
#respond_to_missing?(method, *args) ⇒ Boolean
145 146 147 |
# File 'lib/tweetkit/response.rb', line 145 def respond_to_missing?(method, *args) tweet.respond_to?(method) || super end |