Class: PurolatorRuby::Client

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/purolator_ruby/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



12
13
14
15
# File 'lib/purolator_ruby/client.rb', line 12

def initialize(options = {})
  @credentials = options.fetch(:credentials) { EnvironmentCredentials.new }
  @client = build_client
end

Instance Attribute Details

#credentialsObject (readonly)

Returns the value of attribute credentials.



8
9
10
# File 'lib/purolator_ruby/client.rb', line 8

def credentials
  @credentials
end

Instance Method Details

#build_shipment(options) ⇒ Object



21
22
23
# File 'lib/purolator_ruby/client.rb', line 21

def build_shipment(options)
  PurolatorRuby::CreateShipmentRequest.new(options.merge(client: self))
end

#call(*args) ⇒ Object



17
18
19
# File 'lib/purolator_ruby/client.rb', line 17

def call(*args)
  @client.call(*args)
end