Class: MusicTodayApiWrapper::Resources::Checkout::Billing::Customer

Inherits:
Object
  • Object
show all
Defined in:
lib/resources/checkout/billing/customer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = '', lastname = '', street = '', street_2 = '', city = '', state = '', zip_code = '', phone = '', email = '', country = 'US') ⇒ Customer

rubocop:disable ParameterLists



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/resources/checkout/billing/customer.rb', line 20

def initialize(name = '', lastname = '', street = '', street_2 = '',
  city = '', state = '', zip_code = '', phone = '', email = '',
  country = 'US')
  @name = name
  @lastname = lastname
  @street = street
  @street_2 = street_2
  @city = city
  @state = state
  @zip_code = zip_code
  @phone = phone
  @email = email
  @country = country
end

Instance Attribute Details

#cityObject

Returns the value of attribute city.



8
9
10
# File 'lib/resources/checkout/billing/customer.rb', line 8

def city
  @city
end

#countryObject

Returns the value of attribute country.



8
9
10
# File 'lib/resources/checkout/billing/customer.rb', line 8

def country
  @country
end

#emailObject

Returns the value of attribute email.



8
9
10
# File 'lib/resources/checkout/billing/customer.rb', line 8

def email
  @email
end

#lastnameObject

Returns the value of attribute lastname.



8
9
10
# File 'lib/resources/checkout/billing/customer.rb', line 8

def lastname
  @lastname
end

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/resources/checkout/billing/customer.rb', line 8

def name
  @name
end

#phoneObject

Returns the value of attribute phone.



8
9
10
# File 'lib/resources/checkout/billing/customer.rb', line 8

def phone
  @phone
end

#stateObject

Returns the value of attribute state.



8
9
10
# File 'lib/resources/checkout/billing/customer.rb', line 8

def state
  @state
end

#streetObject

Returns the value of attribute street.



8
9
10
# File 'lib/resources/checkout/billing/customer.rb', line 8

def street
  @street
end

#street_2Object

Returns the value of attribute street_2.



8
9
10
# File 'lib/resources/checkout/billing/customer.rb', line 8

def street_2
  @street_2
end

#zip_codeObject

Returns the value of attribute zip_code.



8
9
10
# File 'lib/resources/checkout/billing/customer.rb', line 8

def zip_code
  @zip_code
end

Instance Method Details

#as_hashObject



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/resources/checkout/billing/customer.rb', line 35

def as_hash
  { firstName: @name,
    lastName: @lastname,
    street: @street,
    street2: @street_2,
    city: @city,
    state: @state,
    postalCode: @zip_code,
    country: @country,
    phone: @phone,
    email: @email }.compact
end