Class: NfseGyn::GerarNfse::Response
Instance Method Summary
collapse
Methods inherited from Response
#class_name, #error_message, #initialize, #link, #municipal_registration, #number, #output, #successful?, #verification_code
Instance Method Details
29
30
31
|
# File 'lib/nfse_gyn/gerar_nfse.rb', line 29
def body
content['ListaNfse']['CompNfse']
end
|
25
26
27
|
# File 'lib/nfse_gyn/gerar_nfse.rb', line 25
def content
@content ||= output['GerarNfseResposta']
end
|
#error? ⇒ Boolean
33
34
35
|
# File 'lib/nfse_gyn/gerar_nfse.rb', line 33
def error?
!content['ListaNfse'] || content['ListaMensagemRetorno']['MensagemRetorno']['Codigo'] != 'L000'
end
|
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/nfse_gyn/gerar_nfse.rb', line 37
def errors
if error?
message = content['ListaMensagemRetorno']['MensagemRetorno']
message = [message] if message.is_a?(Hash)
message
end
rescue StandardError
content
end
|