Class: ActiveShipping::Correios::CorreiosResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/active_shipping/carriers/correios.rb

Instance Method Summary collapse

Constructor Details

#initialize(request, raw_xmls) ⇒ CorreiosResponse

Returns a new instance of CorreiosResponse.



162
163
164
165
166
# File 'lib/active_shipping/carriers/correios.rb', line 162

def initialize(request, raw_xmls)
  @request = request
  @raw_xmls = raw_xmls
  @documents = raw_xmls.map { |xml| Nokogiri::XML(xml) }
end

Instance Method Details

#rate_responseObject



168
169
170
171
172
173
# File 'lib/active_shipping/carriers/correios.rb', line 168

def rate_response
  @rates = rates
  CorreiosRateResponse.new(true, nil, params_options, response_options)
rescue => error
  CorreiosRateResponse.new(false, error.message, {}, response_options)
end