Class: Worldline::Acquiring::SDK::V1::Domain::DccProposal
- Inherits:
-
Domain::DataObject
- Object
- Domain::DataObject
- Worldline::Acquiring::SDK::V1::Domain::DccProposal
- Defined in:
- lib/worldline/acquiring/sdk/v1/domain/dcc_proposal.rb
Instance Attribute Summary collapse
-
#original_amount ⇒ Worldline::Acquiring::SDK::V1::Domain::AmountData
The current value of original_amount.
-
#rate ⇒ Worldline::Acquiring::SDK::V1::Domain::RateData
The current value of rate.
-
#rate_reference_id ⇒ String
The current value of rate_reference_id.
-
#resulting_amount ⇒ Worldline::Acquiring::SDK::V1::Domain::AmountData
The current value of resulting_amount.
Instance Method Summary collapse
Methods inherited from Domain::DataObject
Instance Attribute Details
#original_amount ⇒ Worldline::Acquiring::SDK::V1::Domain::AmountData
Returns the current value of original_amount.
17 18 19 |
# File 'lib/worldline/acquiring/sdk/v1/domain/dcc_proposal.rb', line 17 def original_amount @original_amount end |
#rate ⇒ Worldline::Acquiring::SDK::V1::Domain::RateData
Returns the current value of rate.
17 18 19 |
# File 'lib/worldline/acquiring/sdk/v1/domain/dcc_proposal.rb', line 17 def rate @rate end |
#rate_reference_id ⇒ String
Returns the current value of rate_reference_id.
17 18 19 |
# File 'lib/worldline/acquiring/sdk/v1/domain/dcc_proposal.rb', line 17 def rate_reference_id @rate_reference_id end |
#resulting_amount ⇒ Worldline::Acquiring::SDK::V1::Domain::AmountData
Returns the current value of resulting_amount.
17 18 19 |
# File 'lib/worldline/acquiring/sdk/v1/domain/dcc_proposal.rb', line 17 def resulting_amount @resulting_amount end |
Instance Method Details
#from_hash(hash) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/worldline/acquiring/sdk/v1/domain/dcc_proposal.rb', line 37 def from_hash(hash) super if hash.has_key? 'originalAmount' raise TypeError, "value '%s' is not a Hash" % [hash['originalAmount']] unless hash['originalAmount'].is_a? Hash @original_amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['originalAmount']) end if hash.has_key? 'rate' raise TypeError, "value '%s' is not a Hash" % [hash['rate']] unless hash['rate'].is_a? Hash @rate = Worldline::Acquiring::SDK::V1::Domain::RateData.new_from_hash(hash['rate']) end if hash.has_key? 'rateReferenceId' @rate_reference_id = hash['rateReferenceId'] end if hash.has_key? 'resultingAmount' raise TypeError, "value '%s' is not a Hash" % [hash['resultingAmount']] unless hash['resultingAmount'].is_a? Hash @resulting_amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['resultingAmount']) end end |
#to_h ⇒ Hash
28 29 30 31 32 33 34 35 |
# File 'lib/worldline/acquiring/sdk/v1/domain/dcc_proposal.rb', line 28 def to_h hash = super hash['originalAmount'] = @original_amount.to_h unless @original_amount.nil? hash['rate'] = @rate.to_h unless @rate.nil? hash['rateReferenceId'] = @rate_reference_id unless @rate_reference_id.nil? hash['resultingAmount'] = @resulting_amount.to_h unless @resulting_amount.nil? hash end |