Class: Nfcom::Parsers::Consulta
- Defined in:
- lib/nfcom/parsers/consulta.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Nfcom::Parsers::Base
Instance Method Details
#parse ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/nfcom/parsers/consulta.rb', line 6 def parse ret = find('//nfcom:retConsSitNFCom') raise Errors::SefazError, 'Resposta de consulta inválida' unless ret codigo = xpath(ret, './/nfcom:cStat') motivo = xpath(ret, './/nfcom:xMotivo') { codigo: codigo, motivo: motivo, situacao: interpretar_situacao(codigo), protocolo: xpath(ret, './/nfcom:protNFCom/nfcom:infProt/nfcom:nProt'), data_autorizacao: xpath(ret, './/nfcom:protNFCom/nfcom:infProt/nfcom:dhRecbto') } end |