Class: BrNfe::Product::Response::Build::NfeRecepcaoEvento

Inherits:
Base show all
Defined in:
lib/br_nfe/product/response/build/nfe_recepcao_evento.rb

Instance Attribute Summary

Attributes inherited from Base

#operation, #savon_response

Attributes inherited from ActiveModelBase

#reference

Instance Method Summary collapse

Methods inherited from Base

#body_xml, #doc_original_xml, #header_xml, #nf_xmlns, #nfe_settings, #original_xml, #response, #response_xml, #url_xmlns_retorno, #xml_version, #xml_version_str

Methods inherited from ActiveModelBase

#assign_attributes, #default_values, #initialize

Constructor Details

This class inherits a constructor from BrNfe::ActiveModelBase

Instance Method Details

#evento_request_pathsObject



12
13
14
# File 'lib/br_nfe/product/response/build/nfe_recepcao_evento.rb', line 12

def evento_request_paths
	nfe_settings[:evento_request_paths]
end

#evento_return_pathsObject



15
16
17
# File 'lib/br_nfe/product/response/build/nfe_recepcao_evento.rb', line 15

def evento_return_paths
	nfe_settings[:evento_return_paths]
end

#pathsObject



8
9
10
# File 'lib/br_nfe/product/response/build/nfe_recepcao_evento.rb', line 8

def paths
	operation.gateway_settings[:xml_paths][:recepcao_evento][:return_paths]
end

#response_classObject

Responsável por definir qual classe será instânciada para setar os valores de retorno referentes a cada operação.

Type: Class



24
25
26
# File 'lib/br_nfe/product/response/build/nfe_recepcao_evento.rb', line 24

def response_class
	BrNfe::Product::Response::NfeRecepcaoEvento
end

#specific_attributesObject

Responsável por setar os atributos específicos para cada tipo de operação.

Type: Hash



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/br_nfe/product/response/build/nfe_recepcao_evento.rb', line 33

def specific_attributes
	attrs = {
		environment:              body_xml.xpath( paths[:environment],              paths[:namespaces]).text,
		app_version:              body_xml.xpath( paths[:app_version],              paths[:namespaces]).text,
		processed_at:             body_xml.xpath( paths[:processed_at],             paths[:namespaces]).text,
		processing_status_code:   body_xml.xpath( paths[:processing_status_code],   paths[:namespaces]).text,
		processing_status_motive: body_xml.xpath( paths[:processing_status_motive], paths[:namespaces]).text,
		codigo_orgao:             body_xml.xpath( paths[:codigo_orgao],             paths[:namespaces]).text,
	}
	set_events!( attrs )
	attrs[:xml] = set_xml_events!
	attrs
end