class Tweet
Attributes
Public Class Methods
new(text, hashtags, twitter_client)
click to toggle source
# File lib/tweet.rb, line 4 def initialize(text, hashtags, twitter_client) @text = text @hashtags = hashtags @twitter_client = twitter_client end
Public Instance Methods
append(text)
click to toggle source
# File lib/tweet.rb, line 27 def append(text) @text << ' ' << text end
length()
click to toggle source
# File lib/tweet.rb, line 23 def length with_hashtags.length end
post!(image = '')
click to toggle source
# File lib/tweet.rb, line 10 def post!(image = '') if image.length > 0 && File.exists?(image) @twitter_client.update_with_media(self.with_hashtags, File.new(image)) File.delete(image) else @twitter_client.update(self.with_hashtags) end end