Class: Ingenico::Connect::SDK::Domain::Mandates::MandateAddress

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/mandates/mandate_address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#cityObject

String



14
15
16
# File 'lib/ingenico/connect/sdk/domain/mandates/mandate_address.rb', line 14

def city
  @city
end

#country_codeObject

String



17
18
19
# File 'lib/ingenico/connect/sdk/domain/mandates/mandate_address.rb', line 17

def country_code
  @country_code
end

#house_numberObject

String



20
21
22
# File 'lib/ingenico/connect/sdk/domain/mandates/mandate_address.rb', line 20

def house_number
  @house_number
end

#streetObject

String



23
24
25
# File 'lib/ingenico/connect/sdk/domain/mandates/mandate_address.rb', line 23

def street
  @street
end

#zipObject

String



26
27
28
# File 'lib/ingenico/connect/sdk/domain/mandates/mandate_address.rb', line 26

def zip
  @zip
end

Instance Method Details

#from_hash(hash) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/ingenico/connect/sdk/domain/mandates/mandate_address.rb', line 38

def from_hash(hash)
  super
  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?('street')
    @street = hash['street']
  end
  if hash.has_key?('zip')
    @zip = hash['zip']
  end
end

#to_hObject



28
29
30
31
32
33
34
35
36
# File 'lib/ingenico/connect/sdk/domain/mandates/mandate_address.rb', line 28

def to_h
  hash = super
  add_to_hash(hash, 'city', @city)
  add_to_hash(hash, 'countryCode', @country_code)
  add_to_hash(hash, 'houseNumber', @house_number)
  add_to_hash(hash, 'street', @street)
  add_to_hash(hash, 'zip', @zip)
  hash
end