Class: Facturapi::Helpers::Dte
- Inherits:
-
Object
- Object
- Facturapi::Helpers::Dte
- Defined in:
- lib/facturapi/helpers/dte.rb
Instance Attribute Summary collapse
-
#detalle ⇒ Object
Returns the value of attribute detalle.
-
#dsc_rcg_global ⇒ Object
Returns the value of attribute dsc_rcg_global.
-
#encabezado ⇒ Object
Returns the value of attribute encabezado.
-
#referencia ⇒ Object
Returns the value of attribute referencia.
Instance Method Summary collapse
- #as_node ⇒ Object
-
#initialize(params = {}) ⇒ Dte
constructor
A new instance of Dte.
Constructor Details
#initialize(params = {}) ⇒ Dte
Returns a new instance of Dte.
6 7 8 9 10 11 |
# File 'lib/facturapi/helpers/dte.rb', line 6 def initialize(params = {}) @encabezado = params[:encabezado] self.detalle = params[:detalle] self.dsc_rcg_global = params[:dsc_rcg_global] self.referencia = params[:referencia] end |
Instance Attribute Details
#detalle ⇒ Object
Returns the value of attribute detalle.
4 5 6 |
# File 'lib/facturapi/helpers/dte.rb', line 4 def detalle @detalle end |
#dsc_rcg_global ⇒ Object
Returns the value of attribute dsc_rcg_global.
4 5 6 |
# File 'lib/facturapi/helpers/dte.rb', line 4 def dsc_rcg_global @dsc_rcg_global end |
#encabezado ⇒ Object
Returns the value of attribute encabezado.
4 5 6 |
# File 'lib/facturapi/helpers/dte.rb', line 4 def encabezado @encabezado end |
#referencia ⇒ Object
Returns the value of attribute referencia.
4 5 6 |
# File 'lib/facturapi/helpers/dte.rb', line 4 def referencia @referencia end |
Instance Method Details
#as_node ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/facturapi/helpers/dte.rb', line 43 def as_node doc = XML::Document.new doc.root = create_node('DTE', version: '1.0') do |dte| dte << create_node('Documento', 'ID' => 'F100T39') do |documento| documento << encabezado.as_node detalle.each { |d| documento << d.as_node } dsc_rcg_global.each { |d| documento << d.as_node } referencia.each { |r| documento << r.as_node } end end doc end |