Class: Klarna::Checkout::Address

Inherits:
Resource
  • Object
show all
Defined in:
lib/klarna/checkout/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

defaults, defaults=, #initialize, #json_sanitize, #to_json

Methods included from HasOne

#has_one

Methods included from HasMany

#has_many

Constructor Details

This class inherits a constructor from Klarna::Checkout::Resource

Instance Attribute Details

#care_ofObject

Returns the value of attribute care_of.



4
5
6
# File 'lib/klarna/checkout/address.rb', line 4

def care_of
  @care_of
end

#cityObject

Returns the value of attribute city.



4
5
6
# File 'lib/klarna/checkout/address.rb', line 4

def city
  @city
end

#countryObject

Returns the value of attribute country.



4
5
6
# File 'lib/klarna/checkout/address.rb', line 4

def country
  @country
end

#emailObject

Returns the value of attribute email.



4
5
6
# File 'lib/klarna/checkout/address.rb', line 4

def email
  @email
end

#family_nameObject

Returns the value of attribute family_name.



4
5
6
# File 'lib/klarna/checkout/address.rb', line 4

def family_name
  @family_name
end

#given_nameObject

Returns the value of attribute given_name.



4
5
6
# File 'lib/klarna/checkout/address.rb', line 4

def given_name
  @given_name
end

#phoneObject

Returns the value of attribute phone.



4
5
6
# File 'lib/klarna/checkout/address.rb', line 4

def phone
  @phone
end

#postal_codeObject

Returns the value of attribute postal_code.



4
5
6
# File 'lib/klarna/checkout/address.rb', line 4

def postal_code
  @postal_code
end

#street_addressObject

Returns the value of attribute street_address.



4
5
6
# File 'lib/klarna/checkout/address.rb', line 4

def street_address
  @street_address
end

Instance Method Details

#as_jsonObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/klarna/checkout/address.rb', line 7

def as_json
  json_sanitize({
    :given_name     => @given_name,
    :family_name    => @family_name,
    :care_of        => @care_of,
    :street_address => @street_address,
    :postal_code    => @postal_code,
    :city           => @city,
    :country        => @country,
    :email          => @email,
    :phone          => @phone
  })
end