Class: Retrobot::TweetFilters::SuppressPattern
- Defined in:
- lib/retrobot/tweet_filters/suppress_pattern.rb
Instance Method Summary collapse
- #filter(tweet) ⇒ Object
-
#initialize(retrobot) ⇒ SuppressPattern
constructor
A new instance of SuppressPattern.
Methods inherited from Base
Constructor Details
#initialize(retrobot) ⇒ SuppressPattern
Returns a new instance of SuppressPattern.
6 7 8 |
# File 'lib/retrobot/tweet_filters/suppress_pattern.rb', line 6 def initialize(retrobot) super end |
Instance Method Details
#filter(tweet) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/retrobot/tweet_filters/suppress_pattern.rb', line 10 def filter(tweet) text = text tweet if pattern && text =~ pattern logger.info "Skipped by suppress_pattern: #{tweet.text}" nil else tweet end end |