Class: Hipbot::Adapters::Hipchat
- Inherits:
-
Object
- Object
- Hipbot::Adapters::Hipchat
- Defined in:
- lib/hipbot/adapters/hipchat.rb,
lib/hipbot/adapters/hipchat/initializer.rb
Defined Under Namespace
Classes: Initializer
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #invite_to_room(room, users) ⇒ Object
- #join_room(room) ⇒ Object
- #kick_from_room(room, users) ⇒ Object
- #leave_room(room, reason = '') ⇒ Object
- #restart! ⇒ Object
- #send_to_room(room, message) ⇒ Object
- #send_to_user(user, message) ⇒ Object
- #set_presence(status, type) ⇒ Object
- #set_topic(room, topic) ⇒ Object
- #start! ⇒ Object
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/hipbot/adapters/hipchat.rb', line 4 def client @client end |
Instance Method Details
#invite_to_room(room, users) ⇒ Object
14 15 16 |
# File 'lib/hipbot/adapters/hipchat.rb', line 14 def invite_to_room(room, users) client.invite(user_ids(users), room.id) end |
#join_room(room) ⇒ Object
38 39 40 |
# File 'lib/hipbot/adapters/hipchat.rb', line 38 def join_room(room) client.join(room.id) end |
#kick_from_room(room, users) ⇒ Object
18 19 20 |
# File 'lib/hipbot/adapters/hipchat.rb', line 18 def kick_from_room(room, users) client.kick(user_ids(users), room.id) end |
#leave_room(room, reason = '') ⇒ Object
42 43 44 |
# File 'lib/hipbot/adapters/hipchat.rb', line 42 def leave_room(room, reason = '') client.exit(room.id, reason) end |
#restart! ⇒ Object
10 11 12 |
# File 'lib/hipbot/adapters/hipchat.rb', line 10 def restart! start! end |
#send_to_room(room, message) ⇒ Object
22 23 24 |
# File 'lib/hipbot/adapters/hipchat.rb', line 22 def send_to_room(room, ) client.(:groupchat, room.id, ) end |
#send_to_user(user, message) ⇒ Object
26 27 28 |
# File 'lib/hipbot/adapters/hipchat.rb', line 26 def send_to_user(user, ) client.(:chat, user.id, ) end |
#set_presence(status, type) ⇒ Object
34 35 36 |
# File 'lib/hipbot/adapters/hipchat.rb', line 34 def set_presence(status, type) client.set_presence(type, nil, status) end |
#set_topic(room, topic) ⇒ Object
30 31 32 |
# File 'lib/hipbot/adapters/hipchat.rb', line 30 def set_topic(room, topic) client.(:groupchat, room.id, nil, topic) end |
#start! ⇒ Object
6 7 8 |
# File 'lib/hipbot/adapters/hipchat.rb', line 6 def start! self.client = Initializer.new.client end |