Class: Campfiyah::Room

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(adapter, id, name, updated_at) ⇒ Room

Returns a new instance of Room.



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

def initialize(adapter, id, name, updated_at)
  @adapter, @id, @name, @updated_at = adapter, id, name, updated_at
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/campfiyah/room.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/campfiyah/room.rb', line 3

def name
  @name
end

#updated_atObject

Returns the value of attribute updated_at.



3
4
5
# File 'lib/campfiyah/room.rb', line 3

def updated_at
  @updated_at
end

Class Method Details

.from_hash(hash, adapter) ⇒ Object



8
9
10
# File 'lib/campfiyah/room.rb', line 8

def self.from_hash(hash, adapter)
  new(adapter, hash["id"], hash["name"], hash["updated_at"])
end

Instance Method Details

#message(message) ⇒ Object



12
13
14
# File 'lib/campfiyah/room.rb', line 12

def message(message)
  @adapter.message(id, message)
end