Module: Hipbot::Matchable

Included in:
Bot
Defined in:
lib/hipbot/matchable.rb

Instance Method Summary collapse

Instance Method Details

#react(sender, room, body) ⇒ Object



3
4
5
6
7
# File 'lib/hipbot/matchable.rb', line 3

def react sender, room, body
  message = Message.new(body, room, sender)
  matches = set_matches(reaction_sets, message)
  Match.invoke_all(matches)
end

#react_to_presence(sender, status, room) ⇒ Object



9
10
11
12
13
# File 'lib/hipbot/matchable.rb', line 9

def react_to_presence sender, status, room
  presence = Presence.new(sender, status, room)
  matches  = set_matches(presence_reaction_sets, presence)
  Match.invoke_all(matches)
end

#reactionsObject



15
16
17
# File 'lib/hipbot/matchable.rb', line 15

def reactions
  reaction_sets.flatten
end