Class: PurolatorRuby::Client
- Inherits:
-
Object
- Object
- PurolatorRuby::Client
- Extended by:
- Forwardable
- Defined in:
- lib/purolator_ruby/client.rb
Instance Attribute Summary collapse
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
Instance Method Summary collapse
- #build_shipment(options) ⇒ Object
- #call(*args) ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
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( = {}) @credentials = .fetch(:credentials) { EnvironmentCredentials.new } @client = build_client end |
Instance Attribute Details
#credentials ⇒ Object (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() PurolatorRuby::CreateShipmentRequest.new(.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 |