Class: Reply

Inherits:
Object
  • Object
show all
Defined in:
lib/twiterator/reply.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#authorObject

Returns the value of attribute author.



2
3
4
# File 'lib/twiterator/reply.rb', line 2

def author
  @author
end

#contentObject

Returns the value of attribute content.



2
3
4
# File 'lib/twiterator/reply.rb', line 2

def content
  @content
end

#parent_tweetObject

Returns the value of attribute parent_tweet.



2
3
4
# File 'lib/twiterator/reply.rb', line 2

def parent_tweet
  @parent_tweet
end

#reply_numberObject

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

#dateObject



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_fiveObject



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

#timeObject



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