Class: OnlinePayments::SDK::Domain::CurrencyConversion
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::CurrencyConversion
- Defined in:
- lib/onlinepayments/sdk/domain/currency_conversion.rb
Instance Attribute Summary collapse
-
#accepted_by_user ⇒ true/false
The current value of accepted_by_user.
-
#proposal ⇒ OnlinePayments::SDK::Domain::DccProposal
The current value of proposal.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#accepted_by_user ⇒ true/false
Returns the current value of accepted_by_user.
12 13 14 |
# File 'lib/onlinepayments/sdk/domain/currency_conversion.rb', line 12 def accepted_by_user @accepted_by_user end |
#proposal ⇒ OnlinePayments::SDK::Domain::DccProposal
Returns the current value of proposal.
12 13 14 |
# File 'lib/onlinepayments/sdk/domain/currency_conversion.rb', line 12 def proposal @proposal end |
Instance Method Details
#from_hash(hash) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/onlinepayments/sdk/domain/currency_conversion.rb', line 24 def from_hash(hash) super @accepted_by_user = hash['acceptedByUser'] if hash.key? 'acceptedByUser' 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 end |
#to_h ⇒ Hash
17 18 19 20 21 22 |
# File 'lib/onlinepayments/sdk/domain/currency_conversion.rb', line 17 def to_h hash = super hash['acceptedByUser'] = @accepted_by_user unless @accepted_by_user.nil? hash['proposal'] = @proposal.to_h if @proposal hash end |