Class: Reply
- Inherits:
-
Object
- Object
- Reply
- Defined in:
- lib/twiterator/reply.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#content ⇒ Object
Returns the value of attribute content.
-
#parent_tweet ⇒ Object
Returns the value of attribute parent_tweet.
-
#reply_number ⇒ Object
Returns the value of attribute reply_number.
Instance Method Summary collapse
- #date ⇒ Object
-
#initialize(index, parent_tweet) ⇒ Reply
constructor
A new instance of Reply.
- #show_five ⇒ Object
- #time ⇒ Object
Constructor Details
#initialize(index, parent_tweet) ⇒ Reply
Returns a new instance of Reply.
4 5 6 7 |
# File 'lib/twiterator/reply.rb', line 4 def initialize(index, parent_tweet) @index = index @parent_tweet = parent_tweet end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
2 3 4 |
# File 'lib/twiterator/reply.rb', line 2 def @author end |
#content ⇒ Object
Returns the value of attribute content.
2 3 4 |
# File 'lib/twiterator/reply.rb', line 2 def content @content end |
#parent_tweet ⇒ Object
Returns the value of attribute parent_tweet.
2 3 4 |
# File 'lib/twiterator/reply.rb', line 2 def parent_tweet @parent_tweet end |
#reply_number ⇒ Object
Returns the value of attribute reply_number.
2 3 4 |
# File 'lib/twiterator/reply.rb', line 2 def reply_number @reply_number end |
Instance Method Details
#date ⇒ Object
22 23 24 |
# File 'lib/twiterator/reply.rb', line 22 def date self.parent_tweet.doc.css('.stream-items .stream-item-header .time a')[@index].values[2].split(" - ")[1] end |
#show_five ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/twiterator/reply.rb', line 26 def show_five puts "\n#{self.display_name.upcase}'S MOST RECENT TWEETS:\n" @counter = 0 until self.counter == 5 tweet_cycle end end |
#time ⇒ Object
17 18 19 20 |
# File 'lib/twiterator/reply.rb', line 17 def time #binding.pry self.parent_tweet.doc.css('.stream-items .stream-item-header .time a')[@index].values[2].split(" - ")[0] end |