Class: Lita::Adapters::Gitter
- Inherits:
-
Adapter
- Object
- Adapter
- Lita::Adapters::Gitter
- Defined in:
- lib/lita/adapters/gitter.rb,
lib/lita/adapters/gitter/connection.rb
Overview
Gitter adapter for the Lita chat bot.
Defined Under Namespace
Classes: Connection
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
-
#run ⇒ Object
Delegates main loop execution to Connection Adapter.
-
#send_messages(target, messages) ⇒ Object
Sends one or more messages to a user or room.
- #shut_down ⇒ Object
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
16 17 18 |
# File 'lib/lita/adapters/gitter.rb', line 16 def connection @connection end |
Instance Method Details
#run ⇒ Object
Delegates main loop execution to Connection Adapter
20 21 22 23 24 25 |
# File 'lib/lita/adapters/gitter.rb', line 20 def run return if connection @connection = Connection.new(robot, config) connection.run end |
#send_messages(target, messages) ⇒ Object
Sends one or more messages to a user or room.
32 33 34 35 36 |
# File 'lib/lita/adapters/gitter.rb', line 32 def (target, ) .reject(&:empty?).each do || connection.(target, ) end end |
#shut_down ⇒ Object
38 39 40 41 42 43 |
# File 'lib/lita/adapters/gitter.rb', line 38 def shut_down return unless connection connection.shut_down robot.trigger(:disconnected) end |