Class: ChatX::Room
- Inherits:
-
Object
- Object
- ChatX::Room
- Defined in:
- lib/chatx/models/room.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#owners ⇒ Object
readonly
Returns the value of attribute owners.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#stars ⇒ Object
readonly
Returns the value of attribute stars.
-
#users ⇒ Object
readonly
Returns the value of attribute users.
Instance Method Summary collapse
-
#initialize(server, **opts) ⇒ Room
constructor
A new instance of Room.
Constructor Details
#initialize(server, **opts) ⇒ Room
Returns a new instance of Room.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/chatx/models/room.rb', line 7 def initialize(server, **opts) if opts.values_at(:room_id).any?(&:nil?) raise ArgumentError, 'Got nil for an expected room property' end @server = server @id = opts[:room_id] track_users if opts[:track_users] if opts[:track_starred_messages] if opts[:metadata] end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
5 6 7 |
# File 'lib/chatx/models/room.rb', line 5 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/chatx/models/room.rb', line 5 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/chatx/models/room.rb', line 5 def name @name end |
#owners ⇒ Object (readonly)
Returns the value of attribute owners.
5 6 7 |
# File 'lib/chatx/models/room.rb', line 5 def owners @owners end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
5 6 7 |
# File 'lib/chatx/models/room.rb', line 5 def server @server end |
#stars ⇒ Object (readonly)
Returns the value of attribute stars.
5 6 7 |
# File 'lib/chatx/models/room.rb', line 5 def stars @stars end |
#users ⇒ Object (readonly)
Returns the value of attribute users.
5 6 7 |
# File 'lib/chatx/models/room.rb', line 5 def users @users end |