class ShipCompliant::Configuration

Stores runtime configuration to authenticate user.

ShipCompliant.configure do |c|
  c.partner_key = 'XXXX-XX-XXXXX'
  c.username = 'bob@example.com'
  c.password = 'secret'
  c.log = true # savon log
end

Attributes

log[RW]
partner_key[RW]
password[RW]
username[RW]
wsdl[RW]

Public Class Methods

new() click to toggle source
# File lib/ship_compliant/configuration.rb, line 26
def initialize
  @log = true
  @wsdl = 'https://ws-dev.shipcompliant.com/services/1.2/coreservice.asmx?WSDL'
end

Public Instance Methods

credentials() click to toggle source

Returns a Hash for authenticating each API request.

{
  'PartnerKey' => 'XXXX-XX-XXXXX',
  'Username' => 'bob@example.com',
  'Password' => 'secret'
}
# File lib/ship_compliant/configuration.rb, line 38
def credentials
  {
    'PartnerKey' => partner_key,
    'Username' => username,
    'Password' => password
  }
end