Class: OnlinePayments::SDK::Domain::RateDetails

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/rate_details.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#exchange_rateFloat

Returns the current value of exchange_rate.

Returns:

  • (Float)

    the current value of exchange_rate



14
15
16
# File 'lib/onlinepayments/sdk/domain/rate_details.rb', line 14

def exchange_rate
  @exchange_rate
end

#inverted_exchange_rateFloat

Returns the current value of inverted_exchange_rate.

Returns:

  • (Float)

    the current value of inverted_exchange_rate



14
15
16
# File 'lib/onlinepayments/sdk/domain/rate_details.rb', line 14

def inverted_exchange_rate
  @inverted_exchange_rate
end

#mark_up_rateFloat

Returns the current value of mark_up_rate.

Returns:

  • (Float)

    the current value of mark_up_rate



14
15
16
# File 'lib/onlinepayments/sdk/domain/rate_details.rb', line 14

def mark_up_rate
  @mark_up_rate
end

#quotation_date_timeString

Returns the current value of quotation_date_time.

Returns:

  • (String)

    the current value of quotation_date_time



14
15
16
# File 'lib/onlinepayments/sdk/domain/rate_details.rb', line 14

def quotation_date_time
  @quotation_date_time
end

#sourceString

Returns the current value of source.

Returns:

  • (String)

    the current value of source



14
15
16
# File 'lib/onlinepayments/sdk/domain/rate_details.rb', line 14

def source
  @source
end

Instance Method Details

#from_hash(hash) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/onlinepayments/sdk/domain/rate_details.rb', line 32

def from_hash(hash)
  super
  @exchange_rate = hash['exchangeRate'] if hash.key? 'exchangeRate'
  @inverted_exchange_rate = hash['invertedExchangeRate'] if hash.key? 'invertedExchangeRate'
  @mark_up_rate = hash['markUpRate'] if hash.key? 'markUpRate'
  @quotation_date_time = hash['quotationDateTime'] if hash.key? 'quotationDateTime'
  @source = hash['source'] if hash.key? 'source'
end

#to_hHash

Returns:

  • (Hash)


22
23
24
25
26
27
28
29
30
# File 'lib/onlinepayments/sdk/domain/rate_details.rb', line 22

def to_h
  hash = super
  hash['exchangeRate'] = @exchange_rate unless @exchange_rate.nil?
  hash['invertedExchangeRate'] = @inverted_exchange_rate unless @inverted_exchange_rate.nil?
  hash['markUpRate'] = @mark_up_rate unless @mark_up_rate.nil?
  hash['quotationDateTime'] = @quotation_date_time unless @quotation_date_time.nil?
  hash['source'] = @source unless @source.nil?
  hash
end