Class: BrNfe::Servico::Betha::BuildResponse
- Inherits:
-
ActiveModelBase
- Object
- ActiveModelBase
- BrNfe::Servico::Betha::BuildResponse
- Defined in:
- lib/br_nfe/servico/betha/build_response.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#nfe_method ⇒ Object
Returns the value of attribute nfe_method.
Instance Method Summary collapse
- #error_messages ⇒ Object
-
#initialize(attributes = {}) ⇒ BuildResponse
constructor
A new instance of BuildResponse.
- #response ⇒ Object
- #success? ⇒ Boolean
Methods inherited from ActiveModelBase
#assign_attributes, #default_values
Constructor Details
#initialize(attributes = {}) ⇒ BuildResponse
Returns a new instance of BuildResponse.
7 8 9 10 |
# File 'lib/br_nfe/servico/betha/build_response.rb', line 7 def initialize(attributes = {}) @error_messages = [] super(attributes) end |
Instance Attribute Details
#nfe_method ⇒ Object
Returns the value of attribute nfe_method.
5 6 7 |
# File 'lib/br_nfe/servico/betha/build_response.rb', line 5 def nfe_method @nfe_method end |
Instance Method Details
#error_messages ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/br_nfe/servico/betha/build_response.rb', line 27 def return @error_messages unless @error_messages.blank? ([:lista_nfse][:listamensagem_alerta_retorno]) if [:lista_nfse] ([:lista_mensagem_retorno]) ([:lista_mensagem_retorno_lote]) @error_messages end |
#response ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/br_nfe/servico/betha/build_response.rb', line 16 def response @response ||= BrNfe::Servico::Response::Default.new do |resp| resp.success = success? resp. = resp.notas_fiscais = get_notas_fiscais resp.protocolo = [:protocolo] resp.data_recebimento = [:data_recebimento] resp.numero_lote = [:numero_lote] end end |
#success? ⇒ Boolean
12 13 14 |
# File 'lib/br_nfe/servico/betha/build_response.rb', line 12 def success? .blank? end |