Class: Moov::Models::Components::InvoicePayment

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
Crystalline::MetadataFields
Defined in:
lib/moov/models/components/invoicepayment.rb

Overview

Payment made towards an invoice, will be either a transfer or an external payment.

Instance Method Summary collapse

Methods included from Crystalline::MetadataFields

#field, #fields, included, #marshal_single, #to_dict, #to_json

Constructor Details

#initialize(invoice_payment_id:, invoice_payment_type:, amount:, transfer: nil, external: nil) ⇒ InvoicePayment

Returns a new instance of InvoicePayment.



27
28
29
30
31
32
33
# File 'lib/moov/models/components/invoicepayment.rb', line 27

def initialize(invoice_payment_id:, invoice_payment_type:, amount:, transfer: nil, external: nil)
  @invoice_payment_id = invoice_payment_id
  @invoice_payment_type = invoice_payment_type
  @amount = amount
  @transfer = transfer
  @external = external
end

Instance Method Details

#==(other) ⇒ Object



36
37
38
39
40
41
42
43
44
# File 'lib/moov/models/components/invoicepayment.rb', line 36

def ==(other)
  return false unless other.is_a? self.class
  return false unless @invoice_payment_id == other.invoice_payment_id
  return false unless @invoice_payment_type == other.invoice_payment_type
  return false unless @amount == other.amount
  return false unless @transfer == other.transfer
  return false unless @external == other.external
  true
end