Class: Nfe::Models::ProcEventoNFe

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model, Helpers::XmlModel::NfeModel
Defined in:
lib/nfe/models/procEventoNFe.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers::XmlModel::NfeModel

#add_elements, #check_present, included, #parse!, #parse_elements, #present?, #validate_optional_attributes, #validate_required_attributes

Constructor Details

#initialize(evento, retEvento) ⇒ ProcEventoNFe



9
10
11
12
# File 'lib/nfe/models/procEventoNFe.rb', line 9

def initialize(evento, retEvento)
  @evento = evento
  @retEvento = retEvento
end

Instance Attribute Details

#eventoObject (readonly)

Returns the value of attribute evento.



7
8
9
# File 'lib/nfe/models/procEventoNFe.rb', line 7

def evento
  @evento
end

#retEventoObject (readonly)

Returns the value of attribute retEvento.



7
8
9
# File 'lib/nfe/models/procEventoNFe.rb', line 7

def retEvento
  @retEvento
end

Instance Method Details

#to_xmlObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/nfe/models/procEventoNFe.rb', line 14

def to_xml
  xml = Builder::XmlMarkup.new

  xml.procEventoNFe(xmlns: Models::NFe.namespace, versao: evento.versao) do |node|

    node << @evento.to_xml

    node << @retEvento.to_xml

  end

  xml.target!
end