Class: TwitterHashtag::Tweet

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_hashtag/tweet.rb

Constant Summary collapse

SEPARATOR =
'~'*80

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tweet_hash) ⇒ Tweet

Returns a new instance of Tweet.



12
13
14
# File 'lib/twitter_hashtag/tweet.rb', line 12

def initialize(tweet_hash)
  @tweet_hash = tweet_hash
end

Instance Attribute Details

#tweet_hashObject (readonly)

Returns the value of attribute tweet_hash.



16
17
18
# File 'lib/twitter_hashtag/tweet.rb', line 16

def tweet_hash
  @tweet_hash
end

Class Method Details

.output(results) ⇒ Object



6
7
8
9
10
# File 'lib/twitter_hashtag/tweet.rb', line 6

def self.output(results)
  results.each do |result_line|
    new(result_line).output
  end
end

Instance Method Details

#outputObject



18
19
20
# File 'lib/twitter_hashtag/tweet.rb', line 18

def output
  puts [SEPARATOR, user, text, link].join("\n")
end