Class: Esbit::Room
- Inherits:
-
Object
- Object
- Esbit::Room
- Defined in:
- lib/esbit/room.rb
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.
Instance Method Summary collapse
-
#initialize(room_json, connection) ⇒ Room
constructor
A new instance of Room.
- #say(message) ⇒ Object
Constructor Details
#initialize(room_json, connection) ⇒ Room
Returns a new instance of Room.
5 6 7 8 9 |
# File 'lib/esbit/room.rb', line 5 def initialize(room_json, connection) @id = room_json["id"] @name = room_json["name"] @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
3 4 5 |
# File 'lib/esbit/room.rb', line 3 def connection @connection end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/esbit/room.rb', line 3 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/esbit/room.rb', line 3 def name @name end |
Instance Method Details
#say(message) ⇒ Object
11 12 13 14 |
# File 'lib/esbit/room.rb', line 11 def say() = {message: {type: 'TextMessage', body: }} @connection.post "/room/#{@id}/speak", end |