Module: Rnfse::XMLBuilder::SpeedGov10

Includes:
Abrasf10
Defined in:
lib/rnfse/xml_builder/speed_gov_1_0.rb

Instance Method Summary collapse

Methods included from Abrasf10

extended, included

Methods included from Abrasf10::ClassMethods

#build_cancelar_nfse_xml, #build_consultar_lote_rps_xml, #build_consultar_nfse_por_rps_xml, #build_consultar_nfse_xml, #build_consultar_situacao_lote_rps_xml

Instance Method Details

#build_consultar_nfse_envio_xml(hash = {}) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/rnfse/xml_builder/speed_gov_1_0.rb', line 42

def build_consultar_nfse_envio_xml(hash = {})
  hash = prepare_hash(hash)
  hash = add_p_namespace(hash, %r{
                                   (Prestador|
                                    NumeroNfse|
                                    DataInicial|
                                    DataFinal|
                                    PeriodoEmissao|
                                    Tomador|
                                    IntermediarioServico)
                                  }x)
  inner_xml = ::Gyoku.xml(hash, key_converter: :none)
  Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    xml.send('p:ConsultarNfseEnvio'.to_sym, build_parameters_xmlns) do
      xml << inner_xml
    end
  end.doc
end

#build_consultar_nfse_envio_xmlnsObject



61
62
63
64
65
66
# File 'lib/rnfse/xml_builder/speed_gov_1_0.rb', line 61

def build_consultar_nfse_envio_xmlns()
  {
    'xmlns:p' => "http://ws.speedgov.com.br/consultar_nfse_envio_v1.xsd",
    'xsi:schemaLocation' => "http://ws.speedgov.com.br/consultar_nfse_envio_v1.xsd"
  }
end

#build_consultar_nfse_rps_envio_xml(hash = {}) ⇒ Object



68
69
70
71
72
73
74
75
76
77
# File 'lib/rnfse/xml_builder/speed_gov_1_0.rb', line 68

def build_consultar_nfse_rps_envio_xml(hash = {})
  hash = prepare_hash(hash)
  hash = add_p_namespace(hash, /(Prestador|IdentificacaoRps)/)
  inner_xml = ::Gyoku.xml(hash, key_converter: :none)
  Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    xml.send('p:ConsultarNfseRpsEnvio'.to_sym, build_parameters_xmlns) do
      xml << inner_xml
    end
  end.doc
end

#build_consultar_nfse_rps_envio_xmlnsObject



79
80
81
82
83
84
# File 'lib/rnfse/xml_builder/speed_gov_1_0.rb', line 79

def build_consultar_nfse_rps_envio_xmlns()
  {
    'xmlns:p' => "http://ws.speedgov.com.br/consultar_nfse_rps_envio_v1.xsd",
    'xsi:schemaLocation' => "http://ws.speedgov.com.br/consultar_nfse_rps_envio_v1.xsd"
  }
end

#build_consultar_situacao_lote_rps_envio_xml(hash = {}) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/rnfse/xml_builder/speed_gov_1_0.rb', line 17

def build_consultar_situacao_lote_rps_envio_xml(hash = {})
  hash = prepare_hash(hash)
  hash = add_p_namespace(hash, /(Prestador|Protocolo)/)
  inner_xml = ::Gyoku.xml(hash, key_converter: :none)
  Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    xml.send('p:ConsultarSituacaoLoteRpsEnvio'.to_sym, build_parameters_xmlns) do
      xml << inner_xml
    end
  end.doc
end

#build_consultar_situacao_lote_rps_envio_xmlnsObject



28
29
30
31
32
33
# File 'lib/rnfse/xml_builder/speed_gov_1_0.rb', line 28

def build_consultar_situacao_lote_rps_envio_xmlns()
  {
    'xmlns:p' => "http://ws.speedgov.com.br/consultar_situacao_lote_rps_envio_v1.xsd",
    'xsi:schemaLocation' => "http://ws.speedgov.com.br/consultar_situacao_lote_rps_envio_v1.xsd"
  }
end

#build_header_xmlObject



94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/rnfse/xml_builder/speed_gov_1_0.rb', line 94

def build_header_xml
  Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    xml.cabecalho('versao' => '1',
                  'xmlns:p' => 'http://ws.speedgov.com.br/cabecalho_v1.xsd',
                  'xmlns:ds' => 'http://www.w3.org/2000/09/xmldsig#',
                  'xmlns:p1' => 'http://ws.speedgov.com.br/tipos_v1.xsd',
                  'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
                  'xsi:schemaLocation' => 'http://ws.speedgov.com.br/cabecalho_v1.xsd') do
      xml.versaoDados('1')
      xml.parent.namespace = xml.parent.namespace_definitions.first
    end
  end.doc
end

#build_parameters_xmlnsObject



86
87
88
89
90
91
92
# File 'lib/rnfse/xml_builder/speed_gov_1_0.rb', line 86

def build_parameters_xmlns
  {
    'xmlns:ds' => "http://www.w3.org/2000/09/xmldsig#",
    'xmlns:p1' => "http://ws.speedgov.com.br/tipos_v1.xsd",
    'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance"
  }.merge(self.send("#{Rnfse::CallChain.caller_method()}ns"))
end

#build_recepcionar_lote_rps_xml(hash = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/rnfse/xml_builder/speed_gov_1_0.rb', line 6

def build_recepcionar_lote_rps_xml(hash = {})
  hash = prepare_hash(hash)
  hash = add_p_namespace(hash, /LoteRps/)
  inner_xml = ::Gyoku.xml(hash, key_converter: :none)
  Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    xml.send('p:EnviarLoteRpsEnvio'.to_sym, build_parameters_xmlns) do
      xml << inner_xml
    end
  end.doc
end

#build_recepcionar_lote_rps_xmlnsObject



35
36
37
38
39
40
# File 'lib/rnfse/xml_builder/speed_gov_1_0.rb', line 35

def build_recepcionar_lote_rps_xmlns()
  {
    'xmlns:p' => "http://ws.speedgov.com.br/enviar_lote_rps_envio_v1.xsd",
    'xsi:schemaLocation' => "http://ws.speedgov.com.br/enviar_lote_rps_envio_v1.xsd"
  }
end