require "twitter"
class Sns::Twitter::Base
include ApplicationWorker
def initialize
@client = Twitter::REST::Client.new do |config|
config.consumer_key = env(:twitter_consumer_key)
config.consumer_secret = env(:twitter_consumer_secret)
config.access_token = env(:twitter_access_token)
config.access_token_secret = env(:twitter_access_token_secret)
end
end
end
# this is other files
class Sns::Twitter::Tweet < Sns::Twitter::Base
def tweet(content)
client.update(content)
end
def random_tweet(category)
maxims = Maxim.where(category: category)
maxim = maxims.offset(rand(maxims.count)).first
tweet format_tweet(maxim)
end
private
def format_tweet(maxim)
raise "no maxim" if maxim.blank?
content = <<-BODY.strip_heredoc
"#{maxim.remark}"
- #{maxim.author}
BODY
content << maxim.url if maxim.url.present?
content
end
end
This Error occured. at called client.update(content).
private method `blank?' called for #<Twitter::REST::Client:0x00007fe8a0833868>
And, this Error occured since bundle update. Now, Using twitter 6.2.0.
Before updating it worked fine.
Do you know something about this Error?
When I had executed this code.
This Error occured. at called
client.update(content)
.And, this Error occured since bundle update. Now, Using twitter 6.2.0. Before updating it worked fine. Do you know something about this Error?