Class: SixSaferpay::Refund
- Inherits:
-
Object
- Object
- SixSaferpay::Refund
- Defined in:
- lib/six_saferpay/models/refund.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#description ⇒ Object
Returns the value of attribute description.
-
#order_id ⇒ Object
Returns the value of attribute order_id.
Instance Method Summary collapse
-
#initialize(amount:, order_id: nil, description: nil) ⇒ Refund
constructor
A new instance of Refund.
- #to_hash ⇒ Object (also: #to_h)
Constructor Details
#initialize(amount:, order_id: nil, description: nil) ⇒ Refund
Returns a new instance of Refund.
9 10 11 12 13 14 15 |
# File 'lib/six_saferpay/models/refund.rb', line 9 def initialize(amount:, order_id: nil, description: nil) @amount = SixSaferpay::Amount.new(**amount.to_h) if amount @order_id = order_id @description = description end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
4 5 6 |
# File 'lib/six_saferpay/models/refund.rb', line 4 def amount @amount end |
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/six_saferpay/models/refund.rb', line 4 def description @description end |
#order_id ⇒ Object
Returns the value of attribute order_id.
4 5 6 |
# File 'lib/six_saferpay/models/refund.rb', line 4 def order_id @order_id end |
Instance Method Details
#to_hash ⇒ Object Also known as: to_h
17 18 19 20 21 22 23 |
# File 'lib/six_saferpay/models/refund.rb', line 17 def to_hash hash = Hash.new hash.merge!(amount: @amount.to_h) if @amount hash.merge!(order_id: @order_id) if @order_id hash.merge!(description: @description) if @description hash end |