Exception: Correios::Sigep::TrackShippings
- Inherits:
-
Helper
- Object
- StandardError
- CorreiosException
- Helper
- Correios::Sigep::TrackShippings
- Defined in:
- lib/sigep/requests/track_shippings.rb
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ TrackShippings
constructor
A new instance of TrackShippings.
- #request ⇒ 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.
6 7 8 9 10 11 12 13 14 |
# File 'lib/sigep/requests/track_shippings.rb', line 6 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] super() end |
Instance Method Details
#request ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/sigep/requests/track_shippings.rb', line 16 def request puts xml if @show_request == true begin format_response(Sigep.client.call( :consulta_sro, 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 |