Class: PaysonAPI::V2::Models::Customer

Inherits:
Object
  • Object
show all
Defined in:
lib/payson_api/v2/models/customer.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#cityObject

Returns the value of attribute city.



7
8
9
# File 'lib/payson_api/v2/models/customer.rb', line 7

def city
  @city
end

#country_codeObject

Returns the value of attribute country_code.



7
8
9
# File 'lib/payson_api/v2/models/customer.rb', line 7

def country_code
  @country_code
end

#emailObject

Returns the value of attribute email.



7
8
9
# File 'lib/payson_api/v2/models/customer.rb', line 7

def email
  @email
end

#first_nameObject

Returns the value of attribute first_name.



7
8
9
# File 'lib/payson_api/v2/models/customer.rb', line 7

def first_name
  @first_name
end

#identity_numberObject

Returns the value of attribute identity_number.



7
8
9
# File 'lib/payson_api/v2/models/customer.rb', line 7

def identity_number
  @identity_number
end

#last_nameObject

Returns the value of attribute last_name.



7
8
9
# File 'lib/payson_api/v2/models/customer.rb', line 7

def last_name
  @last_name
end

#phoneObject

Returns the value of attribute phone.



7
8
9
# File 'lib/payson_api/v2/models/customer.rb', line 7

def phone
  @phone
end

#postal_codeObject

Returns the value of attribute postal_code.



7
8
9
# File 'lib/payson_api/v2/models/customer.rb', line 7

def postal_code
  @postal_code
end

#streetObject

Returns the value of attribute street.



7
8
9
# File 'lib/payson_api/v2/models/customer.rb', line 7

def street
  @street
end

#typeObject

Returns the value of attribute type.



7
8
9
# File 'lib/payson_api/v2/models/customer.rb', line 7

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/payson_api/v2/models/customer.rb', line 10

def self.from_hash(hash)
  new.tap do |customer|
    customer.city = hash['city']
    customer.country_code = hash['countryCode']
    customer.first_name = hash['firstName']
    customer.last_name = hash['lastName']
    customer.identity_number = hash['identityNumber']
    customer.email = hash['email']
    customer.postal_code = hash['postalCode']
    customer.phone = hash['phone']
    customer.street = hash['street']
    customer.type = hash['type']
  end
end