Module: HermesAPI

Defined in:
lib/hermes_api.rb,
lib/hermes_api/cache.rb,
lib/hermes_api/version.rb,
lib/hermes_api/connection.rb,
lib/hermes_api/bearer_auth.rb,
lib/hermes_api/configuration.rb,
lib/hermes_api/creation_error.rb,
lib/hermes_api/resources/base.rb,
lib/hermes_api/resources/o_auth.rb,
lib/hermes_api/resources/json_base.rb,
lib/hermes_api/resources/web_tracking.rb,
lib/hermes_api/resources/tracking_event.rb,
lib/hermes_api/shared/return_label_helper.rb,
lib/hermes_api/resources/pickup_return_label.rb,
lib/hermes_api/resources/drop_off_return_label.rb,
lib/hermes_api/resources/print_in_store_qr_code.rb

Defined Under Namespace

Modules: BearerAuth, ReturnLabelHelper Classes: Base, Configuration, Connection, CreationError, DropOffReturnLabel, JsonBase, OAuth, PickupReturnLabel, PrintInStoreQrCode, TrackingEvent, WebTracking

Constant Summary collapse

VERSION =
"0.7.4"
PRODUCTION_SITE =
"https://www.hermes-europe.co.uk"
TESTING_SITE =
"https://sit.hermes-europe.co.uk"
OAUTH_PRODUCTION_SITE =
"https://hermes-client-integration-prod.eu.auth0.com"
OAUTH_TESTING_SITE =
"https://hermes-client-integration-pre.eu.auth0.com"
JSON_PRODUCTION_SITE =
"https://api.hermesworld.co.uk"
JSON_TESTING_SITE =

temporarily disabled until it is fixed JSON_TESTING_SITE = “hermeslive-pre-prod.apigee.net

JSON_PRODUCTION_SITE

Class Method Summary collapse

Class Method Details

.after_configureObject



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/hermes_api/configuration.rb', line 22

def after_configure
  HermesAPI::Base.site = config.env.to_s == "production" ? PRODUCTION_SITE : TESTING_SITE
  HermesAPI::Base.proxy = config.proxy

  HermesAPI::JsonBase.site = config.env.to_s == "production" ? JSON_PRODUCTION_SITE : JSON_TESTING_SITE
  HermesAPI::OAuth.site = config.env.to_s == "production" ? OAUTH_PRODUCTION_SITE : OAUTH_TESTING_SITE

  if defined?(Rails) && Rails.respond_to?(:cache) && Rails.cache.is_a?(ActiveSupport::Cache::Store)
    HermesAPI.cache = Rails.cache
  end
end

.configObject



18
19
20
# File 'lib/hermes_api/configuration.rb', line 18

def config
  @config ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Yields:



34
35
36
37
38
# File 'lib/hermes_api/configuration.rb', line 34

def configure
  yield config

  after_configure
end