Module: Hipbot::Adapter
- Included in:
- Bot
- Defined in:
- lib/hipbot/adapter.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
Instance Method Summary collapse
- #invite_to_room(room, users) ⇒ Object
- #join_room(room) ⇒ Object
- #kick_from_room(room, users) ⇒ Object
- #leave_room(room) ⇒ Object
- #restart! ⇒ Object
- #send_to_room(room, message) ⇒ Object
- #send_to_user(user, message) ⇒ Object
- #set_presence(status, type = :available) ⇒ Object
- #set_topic(room, topic) ⇒ Object
- #start! ⇒ Object
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
3 4 5 |
# File 'lib/hipbot/adapter.rb', line 3 def connection @connection end |
Instance Method Details
#invite_to_room(room, users) ⇒ Object
29 30 31 32 |
# File 'lib/hipbot/adapter.rb', line 29 def invite_to_room(room, users) logger.info("INVITING to #{room}: #{users}") connection.invite_to_room(room, users) end |
#join_room(room) ⇒ Object
19 20 21 22 |
# File 'lib/hipbot/adapter.rb', line 19 def join_room(room) logger.info("JOINING #{room}") connection.join_room(room) end |
#kick_from_room(room, users) ⇒ Object
34 35 36 37 |
# File 'lib/hipbot/adapter.rb', line 34 def kick_from_room(room, users) logger.info("KICKING from #{room}: #{users}") connection.kick_from_room(room, users) end |
#leave_room(room) ⇒ Object
24 25 26 27 |
# File 'lib/hipbot/adapter.rb', line 24 def leave_room(room) logger.info("LEAVING #{room}") connection.leave_room(room) end |
#restart! ⇒ Object
13 14 15 16 17 |
# File 'lib/hipbot/adapter.rb', line 13 def restart! logger.info("RESTARTING") leave_all_rooms connection.restart! end |
#send_to_room(room, message) ⇒ Object
39 40 41 42 |
# File 'lib/hipbot/adapter.rb', line 39 def send_to_room(room, ) logger.info("REPLY in #{room}") connection.send_to_room(room, ) end |
#send_to_user(user, message) ⇒ Object
44 45 46 47 |
# File 'lib/hipbot/adapter.rb', line 44 def send_to_user(user, ) logger.info("REPLY to #{user}") connection.send_to_user(user, ) end |
#set_presence(status, type = :available) ⇒ Object
54 55 56 57 |
# File 'lib/hipbot/adapter.rb', line 54 def set_presence(status, type = :available) logger.info("PRESENCE set to #{type} with '#{status}'") connection.set_presence(status, type) end |
#set_topic(room, topic) ⇒ Object
49 50 51 52 |
# File 'lib/hipbot/adapter.rb', line 49 def set_topic(room, topic) logger.info("TOPIC seting in #{room} to '#{topic}'") connection.set_topic(room, topic) end |
#start! ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/hipbot/adapter.rb', line 5 def start! logger.info("STARTING") self.connection = adapter.new connection.start! set_presence(status) join_rooms(join) end |