Class: OnlinePayments::SDK::Domain::SurchargeRate
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::SurchargeRate
- Defined in:
- lib/onlinepayments/sdk/domain/surcharge_rate.rb
Instance Attribute Summary collapse
-
#ad_valorem_rate ⇒ Float
The current value of ad_valorem_rate.
-
#specific_rate ⇒ Integer
The current value of specific_rate.
-
#surcharge_product_type_id ⇒ String
The current value of surcharge_product_type_id.
-
#surcharge_product_type_version ⇒ String
The current value of surcharge_product_type_version.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#ad_valorem_rate ⇒ Float
Returns the current value of ad_valorem_rate.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 13 def ad_valorem_rate @ad_valorem_rate end |
#specific_rate ⇒ Integer
Returns the current value of specific_rate.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 13 def specific_rate @specific_rate end |
#surcharge_product_type_id ⇒ String
Returns the current value of surcharge_product_type_id.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 13 def surcharge_product_type_id @surcharge_product_type_id end |
#surcharge_product_type_version ⇒ String
Returns the current value of surcharge_product_type_version.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 13 def surcharge_product_type_version @surcharge_product_type_version end |
Instance Method Details
#from_hash(hash) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 29 def from_hash(hash) super @ad_valorem_rate = hash['adValoremRate'] if hash.key? 'adValoremRate' @specific_rate = hash['specificRate'] if hash.key? 'specificRate' @surcharge_product_type_id = hash['surchargeProductTypeId'] if hash.key? 'surchargeProductTypeId' @surcharge_product_type_version = hash['surchargeProductTypeVersion'] if hash.key? 'surchargeProductTypeVersion' end |
#to_h ⇒ Hash
20 21 22 23 24 25 26 27 |
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 20 def to_h hash = super hash['adValoremRate'] = @ad_valorem_rate unless @ad_valorem_rate.nil? hash['specificRate'] = @specific_rate unless @specific_rate.nil? hash['surchargeProductTypeId'] = @surcharge_product_type_id unless @surcharge_product_type_id.nil? hash['surchargeProductTypeVersion'] = @surcharge_product_type_version unless @surcharge_product_type_version.nil? hash end |