Class: Facturae::FacturaeDocument

Inherits:
Object
  • Object
show all
Includes:
Validatable
Defined in:
lib/facturae/models/facturae_document.rb

Overview

Represents a Facturae document.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validatable

#errors, #valid?

Constructor Details

#initialize(file_header: FileHeader.new, seller_party: Party.new, buyer_party: Party.new) ⇒ FacturaeDocument

Returns a new instance of FacturaeDocument.



17
18
19
20
21
22
# File 'lib/facturae/models/facturae_document.rb', line 17

def initialize(file_header: FileHeader.new, seller_party: Party.new, buyer_party: Party.new)
  @file_header = file_header
  @seller_party = seller_party
  @buyer_party = buyer_party
  @invoices = []
end

Instance Attribute Details

#buyer_partyFacturae::Party

The buyer party.

Returns:



9
10
11
# File 'lib/facturae/models/facturae_document.rb', line 9

def buyer_party
  @buyer_party
end

#file_headerFacturae::FileHeader

The file header.

Returns:



9
10
11
# File 'lib/facturae/models/facturae_document.rb', line 9

def file_header
  @file_header
end

#invoicesArray<Facturae::Invoice>

The invoices.

Returns:



9
10
11
# File 'lib/facturae/models/facturae_document.rb', line 9

def invoices
  @invoices
end

#seller_partyFacturae::Party

The seller party.

Returns:



9
10
11
# File 'lib/facturae/models/facturae_document.rb', line 9

def seller_party
  @seller_party
end

Instance Method Details

#add_invoice(invoice) ⇒ Object



24
25
26
# File 'lib/facturae/models/facturae_document.rb', line 24

def add_invoice(invoice)
  @invoices << invoice
end