Class: OnlinePayments::SDK::Domain::CurrencyConversion

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/currency_conversion.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#accepted_by_usertrue/false

Returns the current value of accepted_by_user.

Returns:

  • (true/false)

    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

#proposalOnlinePayments::SDK::Domain::DccProposal

Returns the current value of proposal.

Returns:



12
13
14
# File 'lib/onlinepayments/sdk/domain/currency_conversion.rb', line 12

def proposal
  @proposal
end

Instance Method Details

#from_hash(hash) ⇒ Object



26
27
28
29
30
31
32
33
34
35
# File 'lib/onlinepayments/sdk/domain/currency_conversion.rb', line 26

def from_hash(hash)
  super
  if hash.has_key? 'acceptedByUser'
    @accepted_by_user = hash['acceptedByUser']
  end
  if hash.has_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_hHash

Returns:

  • (Hash)


19
20
21
22
23
24
# File 'lib/onlinepayments/sdk/domain/currency_conversion.rb', line 19

def to_h
  hash = super
  hash['acceptedByUser'] = @accepted_by_user unless @accepted_by_user.nil?
  hash['proposal'] = @proposal.to_h unless @proposal.nil?
  hash
end