Class: Nfe::Services::Dispatch::EnvEvento

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model, Helpers::XmlModel::NfeModel
Defined in:
lib/nfe/services/dispatch/envEvento.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

Instance Attribute Details

#eventoObject

Returns the value of attribute evento.



8
9
10
# File 'lib/nfe/services/dispatch/envEvento.rb', line 8

def evento
  @evento
end

#idLoteObject

Returns the value of attribute idLote.



8
9
10
# File 'lib/nfe/services/dispatch/envEvento.rb', line 8

def idLote
  @idLote
end

#versaoObject

Returns the value of attribute versao.



8
9
10
# File 'lib/nfe/services/dispatch/envEvento.rb', line 8

def versao
  @versao
end

Instance Method Details

#to_xmlObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/nfe/services/dispatch/envEvento.rb', line 15

def to_xml
  xml = Builder::XmlMarkup.new

  xml.envEvento({xmlns: Nfe::Models::NFe.namespace, versao: versao}) do |nfe|
    nfe.idLote idLote

    nfe << evento.to_xml
  end
  xml.target!
end