Class: OnlinePayments::SDK::Domain::SubMerchant
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::SubMerchant
- Defined in:
- lib/onlinepayments/sdk/domain/sub_merchant.rb
Instance Attribute Summary collapse
-
#address ⇒ OnlinePayments::SDK::Domain::Address
The current value of address.
-
#company_identification_number ⇒ String
The current value of company_identification_number.
-
#company_name ⇒ String
The current value of company_name.
-
#merchant_category_code ⇒ String
The current value of merchant_category_code.
-
#merchant_id ⇒ String
The current value of merchant_id.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#address ⇒ OnlinePayments::SDK::Domain::Address
Returns the current value of address.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 15 def address @address end |
#company_identification_number ⇒ String
Returns the current value of company_identification_number.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 15 def company_identification_number @company_identification_number end |
#company_name ⇒ String
Returns the current value of company_name.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 15 def company_name @company_name end |
#merchant_category_code ⇒ String
Returns the current value of merchant_category_code.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 15 def merchant_category_code @merchant_category_code end |
#merchant_id ⇒ String
Returns the current value of merchant_id.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 15 def merchant_id @merchant_id end |
Instance Method Details
#from_hash(hash) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 38 def from_hash(hash) super if hash.has_key? 'address' raise TypeError, "value '%s' is not a Hash" % [hash['address']] unless hash['address'].is_a? Hash @address = OnlinePayments::SDK::Domain::Address.new_from_hash(hash['address']) end if hash.has_key? 'companyIdentificationNumber' @company_identification_number = hash['companyIdentificationNumber'] end if hash.has_key? 'companyName' @company_name = hash['companyName'] end if hash.has_key? 'merchantCategoryCode' @merchant_category_code = hash['merchantCategoryCode'] end if hash.has_key? 'merchantId' @merchant_id = hash['merchantId'] end end |
#to_h ⇒ Hash
28 29 30 31 32 33 34 35 36 |
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 28 def to_h hash = super hash['address'] = @address.to_h unless @address.nil? hash['companyIdentificationNumber'] = @company_identification_number unless @company_identification_number.nil? hash['companyName'] = @company_name unless @company_name.nil? hash['merchantCategoryCode'] = @merchant_category_code unless @merchant_category_code.nil? hash['merchantId'] = @merchant_id unless @merchant_id.nil? hash end |