class Ingenico::Direct::SDK::Domain::AddressPersonal
@attr [String] additional_info
@attr [String] city @attr [String] country_code
@attr [String] house_number
@attr [Ingenico::Direct::SDK::Domain::PersonalName] name @attr [String] state @attr [String] street @attr [String] zip
Attributes
additional_info[RW]
city[RW]
country_code[RW]
house_number[RW]
name[RW]
state[RW]
street[RW]
zip[RW]
Public Instance Methods
from_hash(hash)
click to toggle source
Calls superclass method
Ingenico::Direct::SDK::DataObject#from_hash
# File lib/ingenico/direct/sdk/domain/address_personal.rb, line 43 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' if hash.key? 'name' raise TypeError, "value '%s' is not a Hash" % [hash['name']] unless hash['name'].is_a? Hash @name = Ingenico::Direct::SDK::Domain::PersonalName.new_from_hash(hash['name']) end @state = hash['state'] if hash.key? 'state' @street = hash['street'] if hash.key? 'street' @zip = hash['zip'] if hash.key? 'zip' end
to_h()
click to toggle source
@return (Hash)
Calls superclass method
Ingenico::Direct::SDK::DataObject#to_h
# File lib/ingenico/direct/sdk/domain/address_personal.rb, line 30 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['name'] = @name.to_h if @name hash['state'] = @state unless @state.nil? hash['street'] = @street unless @street.nil? hash['zip'] = @zip unless @zip.nil? hash end