Class: Facturae::FacturaeDocument
- Inherits:
-
Object
- Object
- Facturae::FacturaeDocument
- Includes:
- Validatable
- Defined in:
- lib/facturae/models/facturae_document.rb
Overview
Represents a Facturae document.
Instance Attribute Summary collapse
-
#buyer_party ⇒ Facturae::Party
The buyer party.
-
#file_header ⇒ Facturae::FileHeader
The file header.
-
#invoices ⇒ Array<Facturae::Invoice>
The invoices.
-
#seller_party ⇒ Facturae::Party
The seller party.
Instance Method Summary collapse
-
#add_invoice(invoice) ⇒ Object
-
#initialize(file_header: FileHeader.new, seller_party: Party.new, buyer_party: Party.new) ⇒ FacturaeDocument
constructor
A new instance of FacturaeDocument.
Methods included from Validatable
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_party ⇒ Facturae::Party
The buyer party.
9 10 11 |
# File 'lib/facturae/models/facturae_document.rb', line 9 def buyer_party @buyer_party end |
#file_header ⇒ Facturae::FileHeader
The file header.
9 10 11 |
# File 'lib/facturae/models/facturae_document.rb', line 9 def file_header @file_header end |
#invoices ⇒ Array<Facturae::Invoice>
The invoices.
9 10 11 |
# File 'lib/facturae/models/facturae_document.rb', line 9 def invoices @invoices end |
#seller_party ⇒ Facturae::Party
The seller party.
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 |