Class: Campfiyah::Account
- Inherits:
-
Object
- Object
- Campfiyah::Account
- Defined in:
- lib/campfiyah/account.rb
Instance Attribute Summary collapse
-
#subdomain ⇒ Object
Returns the value of attribute subdomain.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(subdomain, token) ⇒ Account
constructor
A new instance of Account.
- #room_by_id(id) ⇒ Object
- #room_by_name(name) ⇒ Object
- #rooms ⇒ Object
- #user_by_id(id) ⇒ Object
Constructor Details
Instance Attribute Details
#subdomain ⇒ Object
Returns the value of attribute subdomain.
3 4 5 |
# File 'lib/campfiyah/account.rb', line 3 def subdomain @subdomain end |
#token ⇒ Object
Returns the value of attribute token.
3 4 5 |
# File 'lib/campfiyah/account.rb', line 3 def token @token end |
Instance Method Details
#room_by_id(id) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/campfiyah/account.rb', line 23 def room_by_id(id) if @rooms rooms.find {|r| r.id.to_i == id.to_i} else Room.from_hash(@adapter.room_by_id(id), @adapter) end end |
#room_by_name(name) ⇒ Object
31 32 33 |
# File 'lib/campfiyah/account.rb', line 31 def room_by_name(name) rooms.find {|r| r.name == name} end |