Class: OnlinePayments::SDK::Domain::DccProposal
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::DccProposal
- Defined in:
- lib/onlinepayments/sdk/domain/dcc_proposal.rb
Instance Attribute Summary collapse
-
#base_amount ⇒ OnlinePayments::SDK::Domain::AmountOfMoney
The current value of base_amount.
-
#disclaimer_display ⇒ String
The current value of disclaimer_display.
-
#disclaimer_receipt ⇒ String
The current value of disclaimer_receipt.
-
#rate ⇒ OnlinePayments::SDK::Domain::RateDetails
The current value of rate.
-
#target_amount ⇒ OnlinePayments::SDK::Domain::AmountOfMoney
The current value of target_amount.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#base_amount ⇒ OnlinePayments::SDK::Domain::AmountOfMoney
Returns the current value of base_amount.
16 17 18 |
# File 'lib/onlinepayments/sdk/domain/dcc_proposal.rb', line 16 def base_amount @base_amount end |
#disclaimer_display ⇒ String
Returns the current value of disclaimer_display.
16 17 18 |
# File 'lib/onlinepayments/sdk/domain/dcc_proposal.rb', line 16 def disclaimer_display @disclaimer_display end |
#disclaimer_receipt ⇒ String
Returns the current value of disclaimer_receipt.
16 17 18 |
# File 'lib/onlinepayments/sdk/domain/dcc_proposal.rb', line 16 def disclaimer_receipt @disclaimer_receipt end |
#rate ⇒ OnlinePayments::SDK::Domain::RateDetails
Returns the current value of rate.
16 17 18 |
# File 'lib/onlinepayments/sdk/domain/dcc_proposal.rb', line 16 def rate @rate end |
#target_amount ⇒ OnlinePayments::SDK::Domain::AmountOfMoney
Returns the current value of target_amount.
16 17 18 |
# File 'lib/onlinepayments/sdk/domain/dcc_proposal.rb', line 16 def target_amount @target_amount end |
Instance Method Details
#from_hash(hash) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/onlinepayments/sdk/domain/dcc_proposal.rb', line 34 def from_hash(hash) super if hash.key? 'baseAmount' raise TypeError, "value '%s' is not a Hash" % [hash['baseAmount']] unless hash['baseAmount'].is_a? Hash @base_amount = OnlinePayments::SDK::Domain::AmountOfMoney.new_from_hash(hash['baseAmount']) end @disclaimer_display = hash['disclaimerDisplay'] if hash.key? 'disclaimerDisplay' @disclaimer_receipt = hash['disclaimerReceipt'] if hash.key? 'disclaimerReceipt' if hash.key? 'rate' raise TypeError, "value '%s' is not a Hash" % [hash['rate']] unless hash['rate'].is_a? Hash @rate = OnlinePayments::SDK::Domain::RateDetails.new_from_hash(hash['rate']) end if hash.key? 'targetAmount' raise TypeError, "value '%s' is not a Hash" % [hash['targetAmount']] unless hash['targetAmount'].is_a? Hash @target_amount = OnlinePayments::SDK::Domain::AmountOfMoney.new_from_hash(hash['targetAmount']) end end |
#to_h ⇒ Hash
24 25 26 27 28 29 30 31 32 |
# File 'lib/onlinepayments/sdk/domain/dcc_proposal.rb', line 24 def to_h hash = super hash['baseAmount'] = @base_amount.to_h if @base_amount hash['disclaimerDisplay'] = @disclaimer_display unless @disclaimer_display.nil? hash['disclaimerReceipt'] = @disclaimer_receipt unless @disclaimer_receipt.nil? hash['rate'] = @rate.to_h if @rate hash['targetAmount'] = @target_amount.to_h if @target_amount hash end |