Class: Nfcom::Parsers::Status
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/status.rb', line 6 def parse ret = find('//nfcom:retConsStatServNFCom') raise Errors::SefazError, 'Resposta de status inválida' unless ret codigo = xpath(ret, './/nfcom:cStat') motivo = xpath(ret, './/nfcom:xMotivo') { online: codigo.to_s == '107', codigo: codigo, motivo: motivo, tempo_medio: xpath(ret, './/nfcom:tMed'), data_hora: xpath(ret, './/nfcom:dhRecbto') } end |