Class: G4sClient::Shipping

Inherits:
Object
  • Object
show all
Defined in:
lib/g4s_client.rb

Direct Known Subclasses

ShippingLive, ShippingTest

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint = nil) ⇒ Shipping

Returns a new instance of Shipping.



31
32
33
34
35
# File 'lib/g4s_client.rb', line 31

def initialize(endpoint=nil)
  @endpoint = endpoint || ENV['G4S_SHIPPING_ENDPOINT_URL']
  @service = ::Shipping::IPSShippingSoap.new(@endpoint)
  @service.headerhandler << G4SIAuthHeader.new(auth.username, auth.password, auth.accessKey)  # Add the Authentication to the handler
end

Instance Attribute Details

#serviceObject (readonly)

Returns the value of attribute service.



30
31
32
# File 'lib/g4s_client.rb', line 30

def service
  @service
end