Class: BrInvoiceDownload::NfeDistribuicaoDfe
- Inherits:
-
Object
- Object
- BrInvoiceDownload::NfeDistribuicaoDfe
- Defined in:
- lib/br_invoice_download/nfe_distribuicao_dfe.rb
Instance Attribute Summary collapse
-
#certificate_pkcs12_password ⇒ Object
Returns the value of attribute certificate_pkcs12_password.
-
#certificate_pkcs12_path ⇒ Object
Returns the value of attribute certificate_pkcs12_path.
-
#certificate_pkcs12_value ⇒ Object
writeonly
Sets the attribute certificate_pkcs12_value.
-
#cnpj ⇒ Object
Returns the value of attribute cnpj.
-
#ibge_uf ⇒ Object
Returns the value of attribute ibge_uf.
-
#invoice_key ⇒ Object
Returns the value of attribute invoice_key.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ NfeDistribuicaoDfe
constructor
A new instance of NfeDistribuicaoDfe.
- #invoice_hash ⇒ Object
- #invoice_xml ⇒ Object
- #request ⇒ Object
- #response ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ NfeDistribuicaoDfe
Returns a new instance of NfeDistribuicaoDfe.
11 12 13 14 15 |
# File 'lib/br_invoice_download/nfe_distribuicao_dfe.rb', line 11 def initialize(opts={}) opts.each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#certificate_pkcs12_password ⇒ Object
Returns the value of attribute certificate_pkcs12_password.
17 18 19 |
# File 'lib/br_invoice_download/nfe_distribuicao_dfe.rb', line 17 def certificate_pkcs12_password @certificate_pkcs12_password end |
#certificate_pkcs12_path ⇒ Object
Returns the value of attribute certificate_pkcs12_path.
18 19 20 |
# File 'lib/br_invoice_download/nfe_distribuicao_dfe.rb', line 18 def certificate_pkcs12_path @certificate_pkcs12_path end |
#certificate_pkcs12_value=(value) ⇒ Object
Sets the attribute certificate_pkcs12_value
19 20 21 |
# File 'lib/br_invoice_download/nfe_distribuicao_dfe.rb', line 19 def certificate_pkcs12_value=(value) @certificate_pkcs12_value = value end |
#cnpj ⇒ Object
Returns the value of attribute cnpj.
21 22 23 |
# File 'lib/br_invoice_download/nfe_distribuicao_dfe.rb', line 21 def cnpj @cnpj end |
#ibge_uf ⇒ Object
Returns the value of attribute ibge_uf.
20 21 22 |
# File 'lib/br_invoice_download/nfe_distribuicao_dfe.rb', line 20 def ibge_uf @ibge_uf end |
#invoice_key ⇒ Object
Returns the value of attribute invoice_key.
22 23 24 |
# File 'lib/br_invoice_download/nfe_distribuicao_dfe.rb', line 22 def invoice_key @invoice_key end |
Instance Method Details
#invoice_hash ⇒ Object
38 39 40 |
# File 'lib/br_invoice_download/nfe_distribuicao_dfe.rb', line 38 def invoice_hash @invoice ||= handle_invoice end |
#invoice_xml ⇒ Object
42 43 44 |
# File 'lib/br_invoice_download/nfe_distribuicao_dfe.rb', line 42 def invoice_xml @invoice_xml ||= handle_invoice_xml end |
#request ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/br_invoice_download/nfe_distribuicao_dfe.rb', line 28 def request @response = client_wsdl.call(:nfe_dist_d_fe_interesse, xml: soap_xml) rescue Savon::SOAPFault => error return @response = {request_status: :soap_error, request_message_error: error.} rescue Savon::HTTPError => error return @response = {request_status: :http_error, request_message_error: error.} rescue Exception => error return @response = {request_status: :unknown_error, request_message_error: error.} end |
#response ⇒ Object
24 25 26 |
# File 'lib/br_invoice_download/nfe_distribuicao_dfe.rb', line 24 def response @response end |