Class: Retrobot::TweetFilters::Tweet

Inherits:
Base
  • Object
show all
Defined in:
lib/retrobot/tweet_filters/tweet.rb

Instance Method Summary collapse

Methods inherited from Base

#client, #config, #logger

Constructor Details

#initialize(retrobot) ⇒ Tweet

Returns a new instance of Tweet.



7
8
9
# File 'lib/retrobot/tweet_filters/tweet.rb', line 7

def initialize(retrobot)
  super
end

Instance Method Details

#filter(tweet) ⇒ Object



11
12
13
# File 'lib/retrobot/tweet_filters/tweet.rb', line 11

def filter(tweet)
  tweet tweet.text
end

#tweet(text) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/retrobot/tweet_filters/tweet.rb', line 15

def tweet(text)
  logger.info "tweet: #{text}"
  return if config.dryrun
  Retryable.retryable(tries: config.retry_count, sleep: config.retry_interval) do
    client.update text
  end
end