Class: Worldline::Connect::SDK::V1::Domain::Address

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/connect/sdk/v1/domain/address.rb

Direct Known Subclasses

AddressPersonal

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#additional_info ⇒ String



20
21
22
# File 'lib/worldline/connect/sdk/v1/domain/address.rb', line 20

def additional_info
  @additional_info
end

#city ⇒ String



20
21
22
# File 'lib/worldline/connect/sdk/v1/domain/address.rb', line 20

def city
  @city
end

#country_code ⇒ String



20
21
22
# File 'lib/worldline/connect/sdk/v1/domain/address.rb', line 20

def country_code
  @country_code
end

#house_number ⇒ String



20
21
22
# File 'lib/worldline/connect/sdk/v1/domain/address.rb', line 20

def house_number
  @house_number
end

#state ⇒ String



20
21
22
# File 'lib/worldline/connect/sdk/v1/domain/address.rb', line 20

def state
  @state
end

#state_code ⇒ String



20
21
22
# File 'lib/worldline/connect/sdk/v1/domain/address.rb', line 20

def state_code
  @state_code
end

#street ⇒ String



20
21
22
# File 'lib/worldline/connect/sdk/v1/domain/address.rb', line 20

def street
  @street
end

#zip ⇒ String



20
21
22
# File 'lib/worldline/connect/sdk/v1/domain/address.rb', line 20

def zip
  @zip
end

Instance Method Details

#from_hash(hash) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/worldline/connect/sdk/v1/domain/address.rb', line 52

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

#to_h ⇒ Hash



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/worldline/connect/sdk/v1/domain/address.rb', line 39

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['stateCode'] = @state_code unless @state_code.nil?
  hash['street'] = @street unless @street.nil?
  hash['zip'] = @zip unless @zip.nil?
  hash
end