Class: Ticketbai::Nodes::InvoiceData

Inherits:
Object
  • Object
show all
Defined in:
lib/ticketbai/nodes/invoice_data.rb

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ InvoiceData

Returns a new instance of InvoiceData.



4
5
6
7
8
# File 'lib/ticketbai/nodes/invoice_data.rb', line 4

def initialize(args = {})
  @invoice_description = args[:invoice_description]
  @invoice_total = args[:invoice_total]
  @invoice_vat_key = args[:invoice_vat_key]
end

Instance Method Details

#build_xml(node) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ticketbai/nodes/invoice_data.rb', line 10

def build_xml(node)
  node = Nokogiri::XML::Builder.new if node.nil?
  node.DatosFactura do |xml|
    xml.DescripcionFactura @invoice_description
    xml.ImporteTotalFactura @invoice_total
    xml.Claves do
      xml.IDClave do
        xml.ClaveRegimenIvaOpTrascendencia @invoice_vat_key
      end
    end
  end
end