Class: SixSaferpay::Address
- Inherits:
-
Object
- Object
- SixSaferpay::Address
- Defined in:
- lib/six_saferpay/models/address.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#company ⇒ Object
Returns the value of attribute company.
-
#country_code ⇒ Object
Returns the value of attribute country_code.
-
#country_subdevision_code ⇒ Object
Returns the value of attribute country_subdevision_code.
-
#date_of_birth ⇒ Object
Returns the value of attribute date_of_birth.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#legal_form ⇒ Object
Returns the value of attribute legal_form.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#street ⇒ Object
Returns the value of attribute street.
-
#street2 ⇒ Object
Returns the value of attribute street2.
-
#zip ⇒ Object
Returns the value of attribute zip.
Instance Method Summary collapse
-
#initialize(first_name: nil, last_name: nil, date_of_birth: nil, company: nil, gender: nil, legal_form: nil, street: nil, street2: nil, zip: nil, city: nil, country_subdevision_code: nil, country_code: nil, phone: nil, email: nil) ⇒ Address
constructor
A new instance of Address.
- #to_hash ⇒ Object (also: #to_h)
Constructor Details
#initialize(first_name: nil, last_name: nil, date_of_birth: nil, company: nil, gender: nil, legal_form: nil, street: nil, street2: nil, zip: nil, city: nil, country_subdevision_code: nil, country_code: nil, phone: nil, email: nil) ⇒ Address
Returns a new instance of Address.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/six_saferpay/models/address.rb', line 21 def initialize(first_name: nil, last_name: nil, date_of_birth: nil, company: nil, gender: nil, legal_form: nil, street: nil, street2: nil, zip: nil, city: nil, country_subdevision_code: nil, country_code: nil, phone: nil, email: nil ) @first_name = first_name @last_name = last_name @date_of_birth = date_of_birth @company = company @gender = gender @legal_form = legal_form @street = street @street2 = street2 @zip = zip @city = city @country_subdevision_code = country_subdevision_code @country_code = country_code @phone = phone @email = email end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
4 5 6 |
# File 'lib/six_saferpay/models/address.rb', line 4 def city @city end |
#company ⇒ Object
Returns the value of attribute company.
4 5 6 |
# File 'lib/six_saferpay/models/address.rb', line 4 def company @company end |
#country_code ⇒ Object
Returns the value of attribute country_code.
4 5 6 |
# File 'lib/six_saferpay/models/address.rb', line 4 def country_code @country_code end |
#country_subdevision_code ⇒ Object
Returns the value of attribute country_subdevision_code.
4 5 6 |
# File 'lib/six_saferpay/models/address.rb', line 4 def country_subdevision_code @country_subdevision_code end |
#date_of_birth ⇒ Object
Returns the value of attribute date_of_birth.
4 5 6 |
# File 'lib/six_saferpay/models/address.rb', line 4 def date_of_birth @date_of_birth end |
#first_name ⇒ Object
Returns the value of attribute first_name.
4 5 6 |
# File 'lib/six_saferpay/models/address.rb', line 4 def first_name @first_name end |
#gender ⇒ Object
Returns the value of attribute gender.
4 5 6 |
# File 'lib/six_saferpay/models/address.rb', line 4 def gender @gender end |
#last_name ⇒ Object
Returns the value of attribute last_name.
4 5 6 |
# File 'lib/six_saferpay/models/address.rb', line 4 def last_name @last_name end |
#legal_form ⇒ Object
Returns the value of attribute legal_form.
4 5 6 |
# File 'lib/six_saferpay/models/address.rb', line 4 def legal_form @legal_form end |
#phone ⇒ Object
Returns the value of attribute phone.
4 5 6 |
# File 'lib/six_saferpay/models/address.rb', line 4 def phone @phone end |
#street ⇒ Object
Returns the value of attribute street.
4 5 6 |
# File 'lib/six_saferpay/models/address.rb', line 4 def street @street end |
#street2 ⇒ Object
Returns the value of attribute street2.
4 5 6 |
# File 'lib/six_saferpay/models/address.rb', line 4 def street2 @street2 end |
#zip ⇒ Object
Returns the value of attribute zip.
4 5 6 |
# File 'lib/six_saferpay/models/address.rb', line 4 def zip @zip end |
Instance Method Details
#to_hash ⇒ Object Also known as: to_h
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/six_saferpay/models/address.rb', line 52 def to_hash hash = Hash.new hash.merge!(first_name: @first_name) if @first_name hash.merge!(last_name: @last_name) if @last_name hash.merge!(date_of_birth: @date_of_birth) if @date_of_birth hash.merge!(company: @company) if @company hash.merge!(gender: @gender) if @gender hash.merge!(legal_form: @legal_form) if @legal_form hash.merge!(street: @street) if @street hash.merge!(street2: @street2) if @street2.present? hash.merge!(zip: @zip) if @zip hash.merge!(city: @city) if @city hash.merge!(country_subdevision_code: @country_subdevision_code) if @country_subdevision_code hash.merge!(country_code: @country_code) if @country_code hash.merge!(phone: @phone) if @phone hash.merge!(email: @email) if @email hash end |