Sha256: 8950c6360d960f1c698b9a043b8aa6f5dc6fa5f900adc21c74d2906489c0c7c2
Contents?: true
Size: 912 Bytes
Versions: 14
Compression:
Stored size: 912 Bytes
Contents
module Shippinglogic class FedEx # This module is more for application integration, so you can do something like: # # tracking = fedex.tracking # if tracking.valid? # # render a successful response # else # # do something with the errors: fedex.errors # end module Validation # Just an array of errors that were encounted if valid? returns false. def errors @errors ||= [] end # Allows you to determine if the request is valid or not. All validation is delegated to the FedEx # services, so what this does is make a call to FedEx and rescue any errors, then it puts those # error into the 'errors' array. def valid? begin target true rescue Error => e errors.clear self.errors << e.message false end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems