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