Class: Campfiyah::User
- Inherits:
-
Object
- Object
- Campfiyah::User
- Defined in:
- lib/campfiyah/user.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(adapter, id, name, email) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(adapter, id, name, email) ⇒ User
Returns a new instance of User.
4 5 6 |
# File 'lib/campfiyah/user.rb', line 4 def initialize(adapter, id, name, email) @adapter, @id, @name, @email = adapter, id, name, email end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
3 4 5 |
# File 'lib/campfiyah/user.rb', line 3 def email @email end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/campfiyah/user.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/campfiyah/user.rb', line 3 def name @name end |
Class Method Details
.from_hash(hash, adapter) ⇒ Object
8 9 10 |
# File 'lib/campfiyah/user.rb', line 8 def self.from_hash(hash, adapter) new(adapter, hash["id"], hash["name"], hash["email_address"]) end |