Class: Worldline::Acquiring::SDK::V1::Domain::RateData

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/acquiring/sdk/v1/domain/rate_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#exchange_ratefloat

Returns the current value of exchange_rate.

Returns:

  • (float)

    the current value of exchange_rate



18
19
20
# File 'lib/worldline/acquiring/sdk/v1/domain/rate_data.rb', line 18

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



18
19
20
# File 'lib/worldline/acquiring/sdk/v1/domain/rate_data.rb', line 18

def inverted_exchange_rate
  @inverted_exchange_rate
end

#mark_upfloat

Returns the current value of mark_up.

Returns:

  • (float)

    the current value of mark_up



18
19
20
# File 'lib/worldline/acquiring/sdk/v1/domain/rate_data.rb', line 18

def mark_up
  @mark_up
end

#mark_up_basisString

Returns the current value of mark_up_basis.

Returns:

  • (String)

    the current value of mark_up_basis



18
19
20
# File 'lib/worldline/acquiring/sdk/v1/domain/rate_data.rb', line 18

def mark_up_basis
  @mark_up_basis
end

#quotation_date_timeDateTime

Returns the current value of quotation_date_time.

Returns:

  • (DateTime)

    the current value of quotation_date_time



18
19
20
# File 'lib/worldline/acquiring/sdk/v1/domain/rate_data.rb', line 18

def quotation_date_time
  @quotation_date_time
end

Instance Method Details

#from_hash(hash) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/worldline/acquiring/sdk/v1/domain/rate_data.rb', line 41

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? 'markUp'
    @mark_up = hash['markUp']
  end
  if hash.has_key? 'markUpBasis'
    @mark_up_basis = hash['markUpBasis']
  end
  if hash.has_key? 'quotationDateTime'
    @quotation_date_time = DateTime.parse(hash['quotationDateTime'])
  end
end

#to_hHash

Returns:

  • (Hash)


31
32
33
34
35
36
37
38
39
# File 'lib/worldline/acquiring/sdk/v1/domain/rate_data.rb', line 31

def to_h
  hash = super
  hash['exchangeRate'] = @exchange_rate unless @exchange_rate.nil?
  hash['invertedExchangeRate'] = @inverted_exchange_rate unless @inverted_exchange_rate.nil?
  hash['markUp'] = @mark_up unless @mark_up.nil?
  hash['markUpBasis'] = @mark_up_basis unless @mark_up_basis.nil?
  hash['quotationDateTime'] = @quotation_date_time.iso8601(3) unless @quotation_date_time.nil?
  hash
end