Class: ActiveShipping::Correios::CorreiosResponse
- Inherits:
-
Object
- Object
- ActiveShipping::Correios::CorreiosResponse
- Defined in:
- lib/active_shipping/carriers/correios.rb
Instance Method Summary collapse
-
#initialize(request, raw_xmls) ⇒ CorreiosResponse
constructor
A new instance of CorreiosResponse.
- #rate_response ⇒ Object
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_response ⇒ Object
168 169 170 171 172 173 |
# File 'lib/active_shipping/carriers/correios.rb', line 168 def rate_response @rates = rates CorreiosRateResponse.new(true, nil, , ) rescue => error CorreiosRateResponse.new(false, error., {}, ) end |