Class: Nfse::ConsultaLote
- Defined in:
- lib/nfse/consultalote.rb
Instance Attribute Summary collapse
-
#cnpj ⇒ Object
Returns the value of attribute cnpj.
-
#code_ibge ⇒ Object
Returns the value of attribute code_ibge.
-
#inscricao_municipal ⇒ Object
Returns the value of attribute inscricao_municipal.
-
#protocolo ⇒ Object
Returns the value of attribute protocolo.
Instance Method Summary collapse
- #consultar ⇒ Object
-
#initialize(code_ibge, cnpj, inscricao_municipal, protocolo) ⇒ ConsultaLote
constructor
A new instance of ConsultaLote.
Methods inherited from Base
Constructor Details
#initialize(code_ibge, cnpj, inscricao_municipal, protocolo) ⇒ ConsultaLote
Returns a new instance of ConsultaLote.
7 8 9 10 11 12 13 14 |
# File 'lib/nfse/consultalote.rb', line 7 def initialize(code_ibge, cnpj, inscricao_municipal, protocolo) self.template_path = File.("../../templates/", __FILE__) @code_ibge = code_ibge @cnpj = cnpj @inscricao_municipal = inscricao_municipal @protocolo = protocolo end |
Instance Attribute Details
#cnpj ⇒ Object
Returns the value of attribute cnpj.
4 5 6 |
# File 'lib/nfse/consultalote.rb', line 4 def cnpj @cnpj end |
#code_ibge ⇒ Object
Returns the value of attribute code_ibge.
4 5 6 |
# File 'lib/nfse/consultalote.rb', line 4 def code_ibge @code_ibge end |
#inscricao_municipal ⇒ Object
Returns the value of attribute inscricao_municipal.
4 5 6 |
# File 'lib/nfse/consultalote.rb', line 4 def inscricao_municipal @inscricao_municipal end |
#protocolo ⇒ Object
Returns the value of attribute protocolo.
4 5 6 |
# File 'lib/nfse/consultalote.rb', line 4 def protocolo @protocolo end |
Instance Method Details
#consultar ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/nfse/consultalote.rb', line 16 def consultar() wsdl = get_wsdl[@code_ibge] client = Savon.client(wsdl: wsdl) xml = self.render response = client.call(:consultar_lote_rps, xml: xml) data = response.body data = data[:consultar_lote_rps_response][:consultar_lote_rps_result] xml_doc = Nokogiri::XML(data) return xml_doc.xpath("//MensagemRetorno").text() end |