Module: ShippingEasy

Defined in:
lib/shipping_easy/configuration.rb,
lib/shipping_easy.rb,
lib/shipping_easy/version.rb,
lib/shipping_easy/signature.rb,
lib/shipping_easy/authenticator.rb

Overview

Configuration class that stores configuration options for the ShippingEasy API.

ShippingEasy requires an API key and secret combination to authenticate against its API. At the very least these must be supplied in the configuration.

Configuration options are typically set via the ShippingEasy.config method.

Examples:

ShippingEasy.configure do |config|
  config.api_key = "12345"
  config.api_secret = "XXXXXXXXXXXXXXXXXXXXXXXX"
end

See Also:

Defined Under Namespace

Modules: Http, Resources Classes: AccessDeniedError, Authenticator, Configuration, Error, InvalidRequestError, RequestExpiredError, ResourceNotFoundError, SessionExpiredError, Signature, TimestampFormatError

Constant Summary collapse

VERSION =
"0.7.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



26
27
28
# File 'lib/shipping_easy.rb', line 26

def configuration
  @configuration
end

Class Method Details

.api_keyObject



39
40
41
42
# File 'lib/shipping_easy.rb', line 39

def api_key
  return nil if configuration.nil?
  configuration.api_key
end

.api_secretObject



34
35
36
37
# File 'lib/shipping_easy.rb', line 34

def api_secret
  return nil if configuration.nil?
  configuration.api_secret
end

.base_urlObject



54
55
56
57
# File 'lib/shipping_easy.rb', line 54

def base_url
  return nil if configuration.nil?
  configuration.base_url
end

.configure {|configuration| ... } ⇒ Object

Yields:



28
29
30
31
32
# File 'lib/shipping_easy.rb', line 28

def configure
  configuration = ShippingEasy::Configuration.new
  yield(configuration)
  self.configuration = configuration
end

.partner_api_keyObject



49
50
51
52
# File 'lib/shipping_easy.rb', line 49

def partner_api_key
  return nil if configuration.nil?
  configuration.partner_api_key
end

.partner_api_secretObject



44
45
46
47
# File 'lib/shipping_easy.rb', line 44

def partner_api_secret
  return nil if configuration.nil?
  configuration.partner_api_secret
end