Class: SixSaferpay::Amount

Inherits:
Object
  • Object
show all
Defined in:
lib/six_saferpay/models/amount.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:, currency_code:) ⇒ Amount

Returns a new instance of Amount.



6
7
8
9
# File 'lib/six_saferpay/models/amount.rb', line 6

def initialize(value:, currency_code:)
  @value = value
  @currency_code = currency_code
end

Instance Attribute Details

#currency_codeObject

Returns the value of attribute currency_code.



4
5
6
# File 'lib/six_saferpay/models/amount.rb', line 4

def currency_code
  @currency_code
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'lib/six_saferpay/models/amount.rb', line 4

def value
  @value
end

Instance Method Details

#to_hashObject Also known as: to_h



11
12
13
14
15
16
# File 'lib/six_saferpay/models/amount.rb', line 11

def to_hash
  hash = Hash.new
  hash.merge!(value: @value)
  hash.merge!(currency_code: @currency_code)
  hash
end