Class: OnlinePayments::SDK::Domain::MandateAddress

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/mandate_address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#cityString

Returns the current value of city.

Returns:

  • (String)

    the current value of city



14
15
16
# File 'lib/onlinepayments/sdk/domain/mandate_address.rb', line 14

def city
  @city
end

#country_codeString

Returns the current value of country_code.

Returns:

  • (String)

    the current value of country_code



14
15
16
# File 'lib/onlinepayments/sdk/domain/mandate_address.rb', line 14

def country_code
  @country_code
end

#house_numberString

Returns the current value of house_number.

Returns:

  • (String)

    the current value of house_number



14
15
16
# File 'lib/onlinepayments/sdk/domain/mandate_address.rb', line 14

def house_number
  @house_number
end

#streetString

Returns the current value of street.

Returns:

  • (String)

    the current value of street



14
15
16
# File 'lib/onlinepayments/sdk/domain/mandate_address.rb', line 14

def street
  @street
end

#zipString

Returns the current value of zip.

Returns:

  • (String)

    the current value of zip



14
15
16
# File 'lib/onlinepayments/sdk/domain/mandate_address.rb', line 14

def zip
  @zip
end

Instance Method Details

#from_hash(hash) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/onlinepayments/sdk/domain/mandate_address.rb', line 32

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

#to_hHash

Returns:

  • (Hash)


22
23
24
25
26
27
28
29
30
# File 'lib/onlinepayments/sdk/domain/mandate_address.rb', line 22

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