Class: Campfiyah::User

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#emailObject

Returns the value of attribute email.



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

def email
  @email
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#nameObject

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