Class: Worldline::Acquiring::SDK::V1::Domain::DccData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#amountInteger

Returns the current value of amount.

Returns:

  • (Integer)

    the current value of amount



15
16
17
# File 'lib/worldline/acquiring/sdk/v1/domain/dcc_data.rb', line 15

def amount
  @amount
end

#conversion_ratefloat

Returns the current value of conversion_rate.

Returns:

  • (float)

    the current value of conversion_rate



15
16
17
# File 'lib/worldline/acquiring/sdk/v1/domain/dcc_data.rb', line 15

def conversion_rate
  @conversion_rate
end

#currency_codeString

Returns the current value of currency_code.

Returns:

  • (String)

    the current value of currency_code



15
16
17
# File 'lib/worldline/acquiring/sdk/v1/domain/dcc_data.rb', line 15

def currency_code
  @currency_code
end

#number_of_decimalsInteger

Returns the current value of number_of_decimals.

Returns:

  • (Integer)

    the current value of number_of_decimals



15
16
17
# File 'lib/worldline/acquiring/sdk/v1/domain/dcc_data.rb', line 15

def number_of_decimals
  @number_of_decimals
end

Instance Method Details

#from_hash(hash) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/worldline/acquiring/sdk/v1/domain/dcc_data.rb', line 35

def from_hash(hash)
  super
  if hash.has_key? 'amount'
    @amount = hash['amount']
  end
  if hash.has_key? 'conversionRate'
    @conversion_rate = hash['conversionRate']
  end
  if hash.has_key? 'currencyCode'
    @currency_code = hash['currencyCode']
  end
  if hash.has_key? 'numberOfDecimals'
    @number_of_decimals = hash['numberOfDecimals']
  end
end

#to_hHash

Returns:

  • (Hash)


26
27
28
29
30
31
32
33
# File 'lib/worldline/acquiring/sdk/v1/domain/dcc_data.rb', line 26

def to_h
  hash = super
  hash['amount'] = @amount unless @amount.nil?
  hash['conversionRate'] = @conversion_rate unless @conversion_rate.nil?
  hash['currencyCode'] = @currency_code unless @currency_code.nil?
  hash['numberOfDecimals'] = @number_of_decimals unless @number_of_decimals.nil?
  hash
end