Class: AbsenteeCamper::Campfire::Room

Inherits:
Object
  • Object
show all
Defined in:
lib/absentee_camper/campfire/room.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(room_id) ⇒ Room

Returns a new instance of Room.



6
7
8
# File 'lib/absentee_camper/campfire/room.rb', line 6

def initialize(room_id)
  @room_id = room_id
end

Instance Attribute Details

#room_idObject (readonly)

Returns the value of attribute room_id.



4
5
6
# File 'lib/absentee_camper/campfire/room.rb', line 4

def room_id
  @room_id
end

Instance Method Details

#infoObject



42
43
44
# File 'lib/absentee_camper/campfire/room.rb', line 42

def info
  API.get "/room/#{room_id}.json"
end

#joinObject



10
11
12
# File 'lib/absentee_camper/campfire/room.rb', line 10

def join
  post 'join'
end

#leaveObject



14
15
16
# File 'lib/absentee_camper/campfire/room.rb', line 14

def leave
  post 'leave'
end

#lockObject



18
19
20
# File 'lib/absentee_camper/campfire/room.rb', line 18

def lock
  post 'lock'
end

#message(message) ⇒ Object



26
27
28
# File 'lib/absentee_camper/campfire/room.rb', line 26

def message(message)
  send_message message
end

#paste(paste) ⇒ Object



30
31
32
# File 'lib/absentee_camper/campfire/room.rb', line 30

def paste(paste)
  send_message paste, 'PasteMessage'
end

#play_sound(sound) ⇒ Object



34
35
36
# File 'lib/absentee_camper/campfire/room.rb', line 34

def play_sound(sound)
  send_message sound, 'SoundMessage'
end

#transcriptObject



38
39
40
# File 'lib/absentee_camper/campfire/room.rb', line 38

def transcript
  get('transcript')['messages']
end

#unlockObject



22
23
24
# File 'lib/absentee_camper/campfire/room.rb', line 22

def unlock
  post 'unlock'
end