lib/shippinglogic/fedex/response.rb in binarylogic-shippinglogic-1.0.1 vs lib/shippinglogic/fedex/response.rb in binarylogic-shippinglogic-1.0.2
- old
+ new
@@ -1,9 +1,11 @@
module Shippinglogic
class FedEx
# Methods relating to receiving a response from FedEx and cleaning it up.
module Response
+ SUCCESSFUL_SEVERITIES = ["SUCCESS", "NOTE", "WARNING"]
+
private
# Overwriting the request method to clean the response and handle errors.
def request(*args)
response = clean_response(super)
@@ -14,10 +16,10 @@
end
end
# Was the response a success?
def success?(response)
- response.is_a?(Hash) && ["SUCCESS", "NOTE", "WARNING"].include?(response[:highest_severity])
+ response.is_a?(Hash) && SUCCESSFUL_SEVERITIES.include?(response[:highest_severity])
end
# Cleans the response and returns it in a more 'user friendly' format that is easier
# to work with.
def clean_response(response)
\ No newline at end of file