Class: OnlinePayments::SDK::Domain::CurrencyConversionResponse
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::CurrencyConversionResponse
- Defined in:
- lib/onlinepayments/sdk/domain/currency_conversion_response.rb
Instance Attribute Summary collapse
-
#dcc_session_id ⇒ String
The current value of dcc_session_id.
-
#proposal ⇒ OnlinePayments::SDK::Domain::DccProposal
The current value of proposal.
-
#result ⇒ OnlinePayments::SDK::Domain::CurrencyConversionResult
The current value of result.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#dcc_session_id ⇒ String
Returns the current value of dcc_session_id.
14 15 16 |
# File 'lib/onlinepayments/sdk/domain/currency_conversion_response.rb', line 14 def dcc_session_id @dcc_session_id end |
#proposal ⇒ OnlinePayments::SDK::Domain::DccProposal
Returns the current value of proposal.
14 15 16 |
# File 'lib/onlinepayments/sdk/domain/currency_conversion_response.rb', line 14 def proposal @proposal end |
#result ⇒ OnlinePayments::SDK::Domain::CurrencyConversionResult
Returns the current value of result.
14 15 16 |
# File 'lib/onlinepayments/sdk/domain/currency_conversion_response.rb', line 14 def result @result end |
Instance Method Details
#from_hash(hash) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/onlinepayments/sdk/domain/currency_conversion_response.rb', line 28 def from_hash(hash) super @dcc_session_id = hash['dccSessionId'] if hash.key? 'dccSessionId' if hash.key? 'proposal' raise TypeError, "value '%s' is not a Hash" % [hash['proposal']] unless hash['proposal'].is_a? Hash @proposal = OnlinePayments::SDK::Domain::DccProposal.new_from_hash(hash['proposal']) end if hash.key? 'result' raise TypeError, "value '%s' is not a Hash" % [hash['result']] unless hash['result'].is_a? Hash @result = OnlinePayments::SDK::Domain::CurrencyConversionResult.new_from_hash(hash['result']) end end |
#to_h ⇒ Hash
20 21 22 23 24 25 26 |
# File 'lib/onlinepayments/sdk/domain/currency_conversion_response.rb', line 20 def to_h hash = super hash['dccSessionId'] = @dcc_session_id unless @dcc_session_id.nil? hash['proposal'] = @proposal.to_h if @proposal hash['result'] = @result.to_h if @result hash end |