Class: FacturasXML
- Inherits:
-
Object
- Object
- FacturasXML
- Defined in:
- lib/facturas_xml.rb
Instance Attribute Summary collapse
-
#invoice_data ⇒ Object
Returns the value of attribute invoice_data.
-
#signature ⇒ Object
Returns the value of attribute signature.
Class Method Summary collapse
Instance Attribute Details
#invoice_data ⇒ Object
Returns the value of attribute invoice_data.
5 6 7 |
# File 'lib/facturas_xml.rb', line 5 def invoice_data @invoice_data end |
#signature ⇒ Object
Returns the value of attribute signature.
5 6 7 |
# File 'lib/facturas_xml.rb', line 5 def signature @signature end |
Class Method Details
.compra_venta(invoice_data, signature) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/facturas_xml.rb', line 7 def self.compra_venta(invoice_data, signature) @invoice_data = InvoiceData.new(invoice_data).data @signature = signature template = Nokogiri::XML('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>') Nokogiri::XML::Builder.with(template) do |xml| xml.facturaElectronicaCompraVenta('xmlns:xsi': "http://www.w3.org/2001/XMLSchema-instance", 'xsi:noNamespaceSchemaLocation': "facturaElectronicaCompraVenta.xsd") { self.cabecera(xml) @invoice_data[:detalles].each do |data| self.detalle(xml, data) end self.signature(xml) } end end |