Class: Lita::Adapters::Flowdock::MessageHandler
- Inherits:
-
Object
- Object
- Lita::Adapters::Flowdock::MessageHandler
- Defined in:
- lib/lita/adapters/flowdock/message_handler.rb
Instance Method Summary collapse
- #handle ⇒ Object
-
#initialize(robot, robot_id, data, flowdock_client) ⇒ MessageHandler
constructor
A new instance of MessageHandler.
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
#handle ⇒ Object
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" when "message" when "activity.user" handle_user_activity when "action" handle_action else handle_unknown end end |