Exception: Correios::SRO::TrackShippingsList
- Inherits:
-
CorreiosException
- Object
- StandardError
- CorreiosException
- Correios::SRO::TrackShippingsList
- Defined in:
- lib/SRO/requests/track_shippings_list.rb
Constant Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ TrackShippingsList
constructor
A new instance of TrackShippingsList.
- #request ⇒ Object
Methods inherited from CorreiosException
#format_error_message, #generate_exception
Constructor Details
#initialize(data = {}) ⇒ TrackShippingsList
Returns a new instance of TrackShippingsList.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/SRO/requests/track_shippings_list.rb', line 14 def initialize(data = {}) @credentials = Correios.credentials @show_request = data[:show_request] @label_numbers = data[:label_numbers] @query_type = data[:query_type] @result_type = data[:result_type] @language = data[:language] super() end |
Instance Method Details
#request ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/SRO/requests/track_shippings_list.rb', line 25 def request puts xml if @show_request == true begin format_response(CLIENT.client.call(:busca_eventos_lista, soap_action: '', xml: xml).to_hash) rescue Savon::SOAPFault => error generate_exception(error) rescue Savon::HTTPError => error if error.http.code == 401 generate_exception("Unauthorized (#{error.http.code}).") end generate_exception("Unknown HTTP error (#{error.http.code}).") end end |