Class: Worldline::Acquiring::SDK::V1::Domain::DccData
- Inherits:
-
Domain::DataObject
- Object
- Domain::DataObject
- Worldline::Acquiring::SDK::V1::Domain::DccData
- Defined in:
- lib/worldline/acquiring/sdk/v1/domain/dcc_data.rb
Instance Attribute Summary collapse
-
#amount ⇒ Integer
The current value of amount.
-
#conversion_rate ⇒ float
The current value of conversion_rate.
-
#currency_code ⇒ String
The current value of currency_code.
-
#number_of_decimals ⇒ Integer
The current value of number_of_decimals.
Instance Method Summary collapse
Methods inherited from Domain::DataObject
Instance Attribute Details
#amount ⇒ Integer
Returns 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_rate ⇒ float
Returns 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_code ⇒ String
Returns 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_decimals ⇒ Integer
Returns 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_h ⇒ 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 |