Class: Nfe::Services::Dispatch::InutNFe
- Inherits:
-
Object
- Object
- Nfe::Services::Dispatch::InutNFe
- Extended by:
- Enumerize
- Includes:
- ActiveModel::Model, Helpers::XmlModel::NfeModel, Models::Concerns::Ufable
- Defined in:
- lib/nfe/services/dispatch/inutNFe.rb
Instance Attribute Summary collapse
-
#signature ⇒ Object
Returns the value of attribute signature.
-
#versao ⇒ Object
Returns the value of attribute versao.
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
#signature ⇒ Object
Returns the value of attribute signature.
20 21 22 |
# File 'lib/nfe/services/dispatch/inutNFe.rb', line 20 def signature @signature end |
#versao ⇒ Object
Returns the value of attribute versao.
20 21 22 |
# File 'lib/nfe/services/dispatch/inutNFe.rb', line 20 def versao @versao end |
Instance Method Details
#id ⇒ Object
50 51 52 |
# File 'lib/nfe/services/dispatch/inutNFe.rb', line 50 def id "ID#{cUF}#{ano}#{@cnpj}#{mod}#{serie_f}#{nNFIni_f}#{nNFFin_f}" end |
#to_xml ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/nfe/services/dispatch/inutNFe.rb', line 54 def to_xml xml = Builder::XmlMarkup.new xml.inutNFe({xmlns: Models::NFe.namespace, versao: versao}) do |nfe| nfe.infInut(Id: id) { |node| add_elements node } nfe.Signature(xmlns: Models::Signature.namespace) do |node| node << @signature.value end end xml.target! end |