Class: Cetustek::Services::InvoiceXmlBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/cetustek/services/invoice_xml_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(invoice_data) ⇒ InvoiceXmlBuilder

Returns a new instance of InvoiceXmlBuilder.



6
7
8
# File 'lib/cetustek/services/invoice_xml_builder.rb', line 6

def initialize(invoice_data)
  @data = invoice_data
end

Instance Method Details

#buildObject



10
11
12
13
14
15
16
17
# File 'lib/cetustek/services/invoice_xml_builder.rb', line 10

def build
  Xml.document('Invoice') do |invoice|
    add_basic_info(invoice)
    add_buyer_info(invoice)
    add_invoice_type_info(invoice)
    add_details(invoice)
  end
end