Class: Hipbot::Room
Instance Method Summary collapse
- #archived? ⇒ Boolean
- #invite(users) ⇒ Object
- #join ⇒ Object
- #kick(users) ⇒ Object
- #leave ⇒ Object
- #on_join(user) ⇒ Object
- #on_leave(user) ⇒ Object
- #send_message(message) ⇒ Object
- #set_topic(topic) ⇒ Object
Methods included from Cache
Instance Method Details
#archived? ⇒ Boolean
43 44 45 |
# File 'lib/hipbot/room.rb', line 43 def archived? !!attributes[:is_archived] end |
#invite(users) ⇒ Object
27 28 29 |
# File 'lib/hipbot/room.rb', line 27 def invite users Hipbot.invite_to_room(self, users) end |
#join ⇒ Object
35 36 37 |
# File 'lib/hipbot/room.rb', line 35 def join Hipbot.join_room(self) end |
#kick(users) ⇒ Object
31 32 33 |
# File 'lib/hipbot/room.rb', line 31 def kick users Hipbot.kick_from_room(self, users) end |
#leave ⇒ Object
39 40 41 |
# File 'lib/hipbot/room.rb', line 39 def leave Hipbot.leave_room(self) end |
#on_join(user) ⇒ Object
7 8 9 |
# File 'lib/hipbot/room.rb', line 7 def on_join user self.users << user end |
#on_leave(user) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/hipbot/room.rb', line 11 def on_leave user if user.myself? self.destroy else self.users.delete(user) end end |
#send_message(message) ⇒ Object
23 24 25 |
# File 'lib/hipbot/room.rb', line 23 def Hipbot.send_to_room(self, ) end |
#set_topic(topic) ⇒ Object
19 20 21 |
# File 'lib/hipbot/room.rb', line 19 def set_topic topic Hipbot.set_topic(self, topic) end |