Class: Atig::Channel::Retweet

Inherits:
Channel
  • Object
show all
Defined in:
lib/atig/channel/retweet.rb

Instance Method Summary collapse

Constructor Details

#initialize(context, gateway, db) ⇒ Retweet

Returns a new instance of Retweet.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/atig/channel/retweet.rb', line 7

def initialize(context, gateway, db)
  super

  db.statuses.find_all(limit:50).reverse_each {|entry|
    message entry
  }

  db.statuses.listen {|entry|
    message entry
  }
end

Instance Method Details

#channel_nameObject



19
# File 'lib/atig/channel/retweet.rb', line 19

def channel_name; "#retweet" end

#message(entry) ⇒ Object



21
22
23
24
25
# File 'lib/atig/channel/retweet.rb', line 21

def message(entry)
  if entry.status.retweeted_status then
    @channel.message entry
  end
end