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



32
33
34
# File 'lib/absentee_camper/campfire/room.rb', line 32

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

#message(message) ⇒ Object



16
17
18
# File 'lib/absentee_camper/campfire/room.rb', line 16

def message(message)
  send_message message
end

#paste(paste) ⇒ Object



20
21
22
# File 'lib/absentee_camper/campfire/room.rb', line 20

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

#play_sound(sound) ⇒ Object



24
25
26
# File 'lib/absentee_camper/campfire/room.rb', line 24

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

#transcriptObject



28
29
30
# File 'lib/absentee_camper/campfire/room.rb', line 28

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