Class: SEFAZ::Webservice::SAT::Dataset::Cancel

Inherits:
Object
  • Object
show all
Defined in:
lib/sefaz/webservice/sat/dataset/cancel.rb

Overview

Principal classe de elaboração do XML de Cancelamento para o módulo CFe-SAT

Defined Under Namespace

Classes: IDE

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(chCanc) ⇒ Cancel

Returns a new instance of Cancel.



14
15
16
17
# File 'lib/sefaz/webservice/sat/dataset/cancel.rb', line 14

def initialize(chCanc)
  @chCanc = chCanc
  @ide = IDE.new
end

Instance Attribute Details

#ideObject

Returns the value of attribute ide.



10
11
12
# File 'lib/sefaz/webservice/sat/dataset/cancel.rb', line 10

def ide
  @ide
end

Instance Method Details

#gerarCFObject



19
20
21
22
23
24
25
26
27
28
# File 'lib/sefaz/webservice/sat/dataset/cancel.rb', line 19

def gerarCF
  hash = { CFeCanc: { infCFe: { :@chCanc => ("CFe" + @chCanc.to_s) } } }
  hash[:CFeCanc][:infCFe][:ide] = @ide.to_h
  hash[:CFeCanc][:infCFe][:emit] = {}
  hash[:CFeCanc][:infCFe][:dest] = {}
  hash[:CFeCanc][:infCFe][:total] = {}
  hash[:CFeCanc][:infCFe][:infAdic] = {}

  return [hash.to_xml!, hash]
end