Class: Nfe::Models::NFeProc

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model, Helpers::XmlModel::NfeModel
Defined in:
lib/nfe/models/nfeProc.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(nfe, protNFe) ⇒ NFeProc

Returns a new instance of NFeProc.



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

def initialize(nfe, protNFe)
  @nfe = nfe
  @protNFe = protNFe
end

Instance Attribute Details

#nfeObject (readonly)

Returns the value of attribute nfe.



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

def nfe
  @nfe
end

#protNFeObject (readonly)

Returns the value of attribute protNFe.



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

def protNFe
  @protNFe
end

Instance Method Details

#to_xmlObject



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

def to_xml
  xml = Builder::XmlMarkup.new

  xml.nfeProc(xmlns: Models::NFe.namespace, versao: nfe.infNFe.versao) do |node|

    node << @nfe.to_xml

    node << @protNFe.to_xml

  end

  xml.target!
end