Class: OnlinePayments::SDK::Domain::AddressPersonal
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::AddressPersonal
- Defined in:
- lib/onlinepayments/sdk/domain/address_personal.rb
Instance Attribute Summary collapse
-
#additional_info ⇒ String
The current value of additional_info.
-
#city ⇒ String
The current value of city.
-
#company_name ⇒ String
The current value of company_name.
-
#country_code ⇒ String
The current value of country_code.
-
#house_number ⇒ String
The current value of house_number.
-
#name ⇒ OnlinePayments::SDK::Domain::PersonalName
The current value of name.
-
#state ⇒ String
The current value of state.
-
#street ⇒ String
The current value of street.
-
#zip ⇒ String
The current value of zip.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#additional_info ⇒ String
Returns the current value of additional_info.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/address_personal.rb', line 19 def additional_info @additional_info end |
#city ⇒ String
Returns the current value of city.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/address_personal.rb', line 19 def city @city end |
#company_name ⇒ String
Returns the current value of company_name.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/address_personal.rb', line 19 def company_name @company_name end |
#country_code ⇒ String
Returns the current value of country_code.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/address_personal.rb', line 19 def country_code @country_code end |
#house_number ⇒ String
Returns the current value of house_number.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/address_personal.rb', line 19 def house_number @house_number end |
#name ⇒ OnlinePayments::SDK::Domain::PersonalName
Returns the current value of name.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/address_personal.rb', line 19 def name @name end |
#state ⇒ String
Returns the current value of state.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/address_personal.rb', line 19 def state @state end |
#street ⇒ String
Returns the current value of street.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/address_personal.rb', line 19 def street @street end |
#zip ⇒ String
Returns the current value of zip.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/address_personal.rb', line 19 def zip @zip end |
Instance Method Details
#from_hash(hash) ⇒ Object
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 79 80 81 82 83 84 |
# File 'lib/onlinepayments/sdk/domain/address_personal.rb', line 54 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? 'companyName' @company_name = hash['companyName'] 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? 'name' raise TypeError, "value '%s' is not a Hash" % [hash['name']] unless hash['name'].is_a? Hash @name = OnlinePayments::SDK::Domain::PersonalName.new_from_hash(hash['name']) end if hash.has_key? 'state' @state = hash['state'] end if hash.has_key? 'street' @street = hash['street'] end if hash.has_key? 'zip' @zip = hash['zip'] end end |
#to_h ⇒ Hash
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/onlinepayments/sdk/domain/address_personal.rb', line 40 def to_h hash = super hash['additionalInfo'] = @additional_info unless @additional_info.nil? hash['city'] = @city unless @city.nil? hash['companyName'] = @company_name unless @company_name.nil? hash['countryCode'] = @country_code unless @country_code.nil? hash['houseNumber'] = @house_number unless @house_number.nil? hash['name'] = @name.to_h unless @name.nil? hash['state'] = @state unless @state.nil? hash['street'] = @street unless @street.nil? hash['zip'] = @zip unless @zip.nil? hash end |