class Nfe::Models::Evento

Attributes

detEvento[RW]
signature[RW]
uf[RW]

Public Instance Methods

id() click to toggle source
# File lib/nfe/models/evento.rb, line 40
def id
  "ID#{tpEvento}#{chNFe}#{nSeqEvento_f}"
end
to_xml() click to toggle source
# File lib/nfe/models/evento.rb, line 44
def to_xml
  xml = Builder::XmlMarkup.new

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

    evento.infEvento(Id: id) do |infEvento|
      infEvento.cOrgao Nfe::Helpers::UfHelper.code(uf)

      add_elements infEvento

      infEvento << detEvento.to_xml
    end

    evento.Signature(xmlns: Models::Signature.namespace) do |node|
      node << @signature.value
    end

  end
  xml.target!
end

Private Instance Methods

nSeqEvento_f() click to toggle source
# File lib/nfe/models/evento.rb, line 66
def nSeqEvento_f
  "%02d" % nSeqEvento
end