lib/hyper_carrier/carrier.rb
# Validate credentials with a call to the API.
#
# By default this just does a `find_rates` call with the origin and destination both as
# the carrier's default_location. Override to provide alternate functionality, such as
# checking for `test_mode` to use test servers, etc.
#
# @return [Boolean] Should return `true` if the provided credentials proved to work,
#   `false` otherswise.
Validate credentials with a call to the API.
By default this just does a `find_rates` call with the origin and destination both as
the carrier's default_location. Override to provide alternate functionality, such as
checking for `test_mode` to use test servers, etc.
Validate credentials with a call to the API . By default this just does a ` find_rates ` call with the origin and destination both as the carrier ' s default_location . Override to provide alternate functionality such as checking for ` test_mode ` to use test servers etc .
def valid_credentials?
      location = self.class.default_location
      find_rates(location, location, Package.new(100, [5, 15, 30]), :test => test_mode)
    rescue HyperCarrier::ResponseError
      false
    else
      true
    end
def valid_credentials? location = self . class . default_location find_rates ( location , location , Package . new ( 100 , [ 5 , 15 , 30 ] ) , :test => test_mode ) rescue HyperCarrier :: ResponseError false else true end
Validate credentials with a call to the API.
Validate credentials with a call to the API .
Should return `true` if the provided credentials proved to work, `false` otherswise.
Should return ` true ` if the provided credentials proved to work ` false ` otherswise .
Boolean