Class: TweetSlim
- Inherits:
-
Object
- Object
- TweetSlim
- Defined in:
- lib/lesser_evil/tweet_slim.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#candidate ⇒ Object
Returns the value of attribute candidate.
-
#id ⇒ Object
Returns the value of attribute id.
-
#orig_id ⇒ Object
Returns the value of attribute orig_id.
-
#text ⇒ Object
Returns the value of attribute text.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(candidate, status) ⇒ TweetSlim
constructor
A new instance of TweetSlim.
- #prettyprint ⇒ Object
Constructor Details
#initialize(candidate, status) ⇒ TweetSlim
Returns a new instance of TweetSlim.
5 6 7 8 9 10 11 12 |
# File 'lib/lesser_evil/tweet_slim.rb', line 5 def initialize(candidate,status) @text = status["text"] @author = status["user"]["screen_name"] @timestamp = status["created_at"] @id = status["id"] @candidate = candidate @orig_id = status["retweeted_status"] == nil ? nil : status["retweeted_status"]["id"] end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
3 4 5 |
# File 'lib/lesser_evil/tweet_slim.rb', line 3 def @author end |
#candidate ⇒ Object
Returns the value of attribute candidate.
3 4 5 |
# File 'lib/lesser_evil/tweet_slim.rb', line 3 def candidate @candidate end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/lesser_evil/tweet_slim.rb', line 3 def id @id end |
#orig_id ⇒ Object
Returns the value of attribute orig_id.
3 4 5 |
# File 'lib/lesser_evil/tweet_slim.rb', line 3 def orig_id @orig_id end |
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/lesser_evil/tweet_slim.rb', line 3 def text @text end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
3 4 5 |
# File 'lib/lesser_evil/tweet_slim.rb', line 3 def @timestamp end |
Instance Method Details
#prettyprint ⇒ Object
14 15 16 17 |
# File 'lib/lesser_evil/tweet_slim.rb', line 14 def prettyprint puts @text.light_black puts "@#{@author} #{@timestamp}".light_blue end |