Class: Nfe::Services::Dispatch::EnviNFe
- Inherits:
-
Object
- Object
- Nfe::Services::Dispatch::EnviNFe
- Includes:
- ActiveModel::Model, Helpers::XmlModel::NfeModel
- Defined in:
- lib/nfe/services/dispatch/enviNFe.rb
Instance Attribute Summary collapse
-
#lote ⇒ Object
Returns the value of attribute lote.
-
#nfe ⇒ Object
Returns the value of attribute nfe.
-
#versao ⇒ Object
Returns the value of attribute versao.
Instance Method Summary collapse
-
#initialize(nfe, lote, version) ⇒ EnviNFe
constructor
A new instance of EnviNFe.
- #to_xml ⇒ Object
Methods included from Helpers::XmlModel::NfeModel
#add_elements, #check_present, included, #parse!, #parse_elements, #present?, #validate_optional_attributes, #validate_required_attributes
Constructor Details
#initialize(nfe, lote, version) ⇒ EnviNFe
Returns a new instance of EnviNFe.
19 20 21 22 23 |
# File 'lib/nfe/services/dispatch/enviNFe.rb', line 19 def initialize(nfe, lote, version) @nfe = nfe @lote = lote @versao = version end |
Instance Attribute Details
#lote ⇒ Object
Returns the value of attribute lote.
8 9 10 |
# File 'lib/nfe/services/dispatch/enviNFe.rb', line 8 def lote @lote end |
#nfe ⇒ Object
Returns the value of attribute nfe.
8 9 10 |
# File 'lib/nfe/services/dispatch/enviNFe.rb', line 8 def nfe @nfe end |
#versao ⇒ Object
Returns the value of attribute versao.
8 9 10 |
# File 'lib/nfe/services/dispatch/enviNFe.rb', line 8 def versao @versao end |
Instance Method Details
#to_xml ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/nfe/services/dispatch/enviNFe.rb', line 25 def to_xml xml = Builder::XmlMarkup.new xml.enviNFe(xmlns: Models::NFe.namespace, versao: versao) do |env| env.idLote @lote env.indSinc SYNCHRONOUS env << @nfe.to_xml end xml.target! end |