Exception: Correios::SRO::TrackShippings
- Inherits:
-
Helper
- Object
- StandardError
- CorreiosException
- Helper
- Correios::SRO::TrackShippings
- Defined in:
- lib/SRO/requests/track_shippings.rb
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ TrackShippings
constructor
A new instance of TrackShippings.
- #request(method) ⇒ Object
Methods inherited from Helper
#array_to_string, #array_to_string_comma, #bool_to_int, #bool_to_string, #calculate_reverse_shipping_deadline, #calculate_shipping_deadline, #date_to_string, #decimal_to_string, #generate_http_exception, #generate_revese_logistics_exception, #generate_soap_fault_exception, #generate_sro_exception, #inverse_card_status, #inverse_object_type, #inverse_payment_method, #inverse_reverse_shipping_type, #inverse_service_availability, #inverse_shipping_cancellation, #inverse_tracking_event_status, #object_type, #payment_method, #pricefier_object_type, #remove_label_digit_checker, #reverse_shipping_service, #reverse_shipping_type, #reverse_tracking_result_type, #string_to_bool, #string_to_date, #string_to_decimal, #string_to_time, #string_to_time_no_second, #ticket_type, #tracking_language, #tracking_query_type, #tracking_result_type
Methods inherited from CorreiosException
Constructor Details
#initialize(data = {}) ⇒ TrackShippings
Returns a new instance of TrackShippings.
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/SRO/requests/track_shippings.rb', line 4 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(method) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/SRO/requests/track_shippings.rb', line 15 def request(method) @method = method @method_snake = method.underscore puts xml if @show_request == true begin format_response(SRO.client.call( @method_snake.to_sym, soap_action: '', xml: xml ).to_hash) rescue Savon::SOAPFault => error generate_soap_fault_exception(error) rescue Savon::HTTPError => error generate_http_exception(error.http.code) end end |