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

#cityString



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

def city
  @city
end

#country_codeString



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

def country_code
  @country_code
end

#house_numberString



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

def house_number
  @house_number
end

#streetString



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

def street
  @street
end

#zipString



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

def zip
  @zip
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

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_hHash



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

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