Class: Lita::Adapters::Flowdock::MessageHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/lita/adapters/flowdock/message_handler.rb

Instance Method Summary collapse

Constructor Details

#initialize(robot, robot_id, data, flowdock_client) ⇒ MessageHandler

Returns a new instance of MessageHandler.



8
9
10
11
12
13
14
# File 'lib/lita/adapters/flowdock/message_handler.rb', line 8

def initialize(robot, robot_id, data, flowdock_client)
  @robot = robot
  @robot_id = robot_id
  @data = data
  @flowdock_client = flowdock_client
  @type = data['event']
end

Instance Method Details

#handleObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/lita/adapters/flowdock/message_handler.rb', line 16

def handle
  case type
  when "comment"
    handle_message
  when "message"
    handle_message
  when "activity.user"
    handle_user_activity
  when "action"
    handle_action
  else
    handle_unknown
  end
end