Class: Ingenico::Direct::SDK::Domain::Address

Inherits:
Ingenico::Direct::SDK::DataObject show all
Defined in:
lib/ingenico/direct/sdk/domain/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Direct::SDK::DataObject

new_from_hash

Instance Attribute Details

#additional_infoString

Returns the current value of additional_info.

Returns:

  • (String)

    the current value of additional_info



17
18
19
# File 'lib/ingenico/direct/sdk/domain/address.rb', line 17

def additional_info
  @additional_info
end

#cityString

Returns the current value of city.

Returns:

  • (String)

    the current value of city



17
18
19
# File 'lib/ingenico/direct/sdk/domain/address.rb', line 17

def city
  @city
end

#country_codeString

Returns the current value of country_code.

Returns:

  • (String)

    the current value of country_code



17
18
19
# File 'lib/ingenico/direct/sdk/domain/address.rb', line 17

def country_code
  @country_code
end

#house_numberString

Returns the current value of house_number.

Returns:

  • (String)

    the current value of house_number



17
18
19
# File 'lib/ingenico/direct/sdk/domain/address.rb', line 17

def house_number
  @house_number
end

#stateString

Returns the current value of state.

Returns:

  • (String)

    the current value of state



17
18
19
# File 'lib/ingenico/direct/sdk/domain/address.rb', line 17

def state
  @state
end

#streetString

Returns the current value of street.

Returns:

  • (String)

    the current value of street



17
18
19
# File 'lib/ingenico/direct/sdk/domain/address.rb', line 17

def street
  @street
end

#zipString

Returns the current value of zip.

Returns:

  • (String)

    the current value of zip



17
18
19
# File 'lib/ingenico/direct/sdk/domain/address.rb', line 17

def zip
  @zip
end

Instance Method Details

#from_hash(hash) ⇒ Object



39
40
41
42
43
44
45
46
47
48
# File 'lib/ingenico/direct/sdk/domain/address.rb', line 39

def from_hash(hash)
  super
  @additional_info = hash['additionalInfo'] if hash.key? 'additionalInfo'
  @city = hash['city'] if hash.key? 'city'
  @country_code = hash['countryCode'] if hash.key? 'countryCode'
  @house_number = hash['houseNumber'] if hash.key? 'houseNumber'
  @state = hash['state'] if hash.key? 'state'
  @street = hash['street'] if hash.key? 'street'
  @zip = hash['zip'] if hash.key? 'zip'
end

#to_hHash

Returns:

  • (Hash)


27
28
29
30
31
32
33
34
35
36
37
# File 'lib/ingenico/direct/sdk/domain/address.rb', line 27

def to_h
  hash = super
  hash['additionalInfo'] = @additional_info unless @additional_info.nil?
  hash['city'] = @city unless @city.nil?
  hash['countryCode'] = @country_code unless @country_code.nil?
  hash['houseNumber'] = @house_number unless @house_number.nil?
  hash['state'] = @state unless @state.nil?
  hash['street'] = @street unless @street.nil?
  hash['zip'] = @zip unless @zip.nil?
  hash
end