Class: Matchstick::Room
Constant Summary
Constants inherited from Campfire
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Campfire
#api_key, #subdomain, #use_ssl
Instance Method Summary collapse
-
#initialize(raw_room, connection) ⇒ Room
constructor
A new instance of Room.
- #join ⇒ Object
- #leave ⇒ Object
- #paste(message) ⇒ Object
- #speak(message) ⇒ Object
Methods inherited from Campfire
Constructor Details
#initialize(raw_room, connection) ⇒ Room
Returns a new instance of Room.
7 8 9 10 11 |
# File 'lib/matchstick/room.rb', line 7 def initialize(raw_room, connection) @name = raw_room["name"] @id = raw_room["id"] @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
5 6 7 |
# File 'lib/matchstick/room.rb', line 5 def connection @connection end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/matchstick/room.rb', line 5 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/matchstick/room.rb', line 5 def name @name end |
Instance Method Details
#join ⇒ Object
25 26 27 |
# File 'lib/matchstick/room.rb', line 25 def join post("room/#{@id}/join") end |
#leave ⇒ Object
29 30 31 |
# File 'lib/matchstick/room.rb', line 29 def leave post("room/#{@id}/leave") end |
#paste(message) ⇒ Object
19 20 21 22 23 |
# File 'lib/matchstick/room.rb', line 19 def paste() post("room/#{@id}/speak", {:message => {:type => "PasteMessage", :body => } }) end |
#speak(message) ⇒ Object
13 14 15 16 17 |
# File 'lib/matchstick/room.rb', line 13 def speak() post("room/#{@id}/speak", {:message => {:type => "TextMessage", :body => } }) end |