Class: NfseGyn::ConsultarNfse::Response

Inherits:
Response
  • Object
show all
Defined in:
lib/nfse_gyn/consultar_nfse.rb

Direct Known Subclasses

MockConsultarNfseResponse

Instance Method Summary collapse

Methods inherited from Response

#class_name, #error_message, #initialize, #output, #successful?

Constructor Details

This class inherits a constructor from NfseGyn::Response

Instance Method Details

#contentObject



45
46
47
# File 'lib/nfse_gyn/consultar_nfse.rb', line 45

def content
  @content ||= output['ConsultarNfseRpsResposta']
end

#error?Boolean



57
58
59
# File 'lib/nfse_gyn/consultar_nfse.rb', line 57

def error?
  !content['CompNfse'] || content['ListaMensagemRetorno']['MensagemRetorno']['Codigo'] != 'L000'
end

#numberObject



49
50
51
# File 'lib/nfse_gyn/consultar_nfse.rb', line 49

def number
  content['CompNfse']['Nfse']['InfNfse']['Numero'] if successful?
end

#verification_codeObject



53
54
55
# File 'lib/nfse_gyn/consultar_nfse.rb', line 53

def verification_code
  content['CompNfse']['Nfse']['InfNfse']['CodigoVerificacao'] if successful?
end