Class: SixSaferpay::Invoice
- Inherits:
-
Object
- Object
- SixSaferpay::Invoice
- Defined in:
- lib/six_saferpay/models/invoice.rb
Instance Attribute Summary collapse
-
#due_date ⇒ Object
Returns the value of attribute due_date.
-
#payee ⇒ Object
Returns the value of attribute payee.
-
#reason_for_transfer ⇒ Object
Returns the value of attribute reason_for_transfer.
Instance Method Summary collapse
-
#initialize(payee: nil, reason_for_transfer: nil, due_date: nil) ⇒ Invoice
constructor
A new instance of Invoice.
- #to_hash ⇒ Object (also: #to_h)
Constructor Details
#initialize(payee: nil, reason_for_transfer: nil, due_date: nil) ⇒ Invoice
Returns a new instance of Invoice.
6 7 8 9 10 |
# File 'lib/six_saferpay/models/invoice.rb', line 6 def initialize(payee: nil, reason_for_transfer: nil, due_date: nil) @payee = SixSaferpay::Payee.new(**payee.to_h) if payee @reason_for_transfer = reason_for_transfer @due_date = due_date end |
Instance Attribute Details
#due_date ⇒ Object
Returns the value of attribute due_date.
4 5 6 |
# File 'lib/six_saferpay/models/invoice.rb', line 4 def due_date @due_date end |
#payee ⇒ Object
Returns the value of attribute payee.
4 5 6 |
# File 'lib/six_saferpay/models/invoice.rb', line 4 def payee @payee end |
#reason_for_transfer ⇒ Object
Returns the value of attribute reason_for_transfer.
4 5 6 |
# File 'lib/six_saferpay/models/invoice.rb', line 4 def reason_for_transfer @reason_for_transfer end |
Instance Method Details
#to_hash ⇒ Object Also known as: to_h
12 13 14 15 16 17 18 |
# File 'lib/six_saferpay/models/invoice.rb', line 12 def to_hash hash = Hash.new hash.merge!(payee: @payee.to_h) if @payee hash.merge!(reason_for_transfer: @reason_for_transfer) if @reason_for_transfer hash.merge!(due_date: @due_date) if @due_date hash end |