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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from 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



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/onlinepayments/sdk/domain/rate_details.rb', line 37

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

#to_hHash

Returns:

  • (Hash)


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

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