Class: Hipbot::Room

Inherits:
Object
  • Object
show all
Includes:
Cache
Defined in:
lib/hipbot/room.rb

Instance Method Summary collapse

Methods included from Cache

#_cache

Instance Method Details

#archived?Boolean

Returns:

  • (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

#joinObject



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

#leaveObject



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 send_message message
  Hipbot.send_to_room(self, message)
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