Class: SimpleShipping::Abstract::Request
- Inherits:
-
Object
- Object
- SimpleShipping::Abstract::Request
- Defined in:
- lib/simple_shipping/abstract/request.rb
Overview
Base class for request builders. Every service has its own implementation.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(credentials) ⇒ Request
constructor
A new instance of Request.
-
#response(savon_response) ⇒ SimpleShipping::Abstract::Response
Wrap the Savon response with specific response for shipment provider.
-
#response_class ⇒ Class
Response class to wrap Savon response.
Constructor Details
#initialize(credentials) ⇒ Request
Returns a new instance of Request.
7 8 9 |
# File 'lib/simple_shipping/abstract/request.rb', line 7 def initialize(credentials) @credentials = credentials end |
Instance Attribute Details
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
4 5 6 |
# File 'lib/simple_shipping/abstract/request.rb', line 4 def credentials @credentials end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/simple_shipping/abstract/request.rb', line 5 def type @type end |
Instance Method Details
#response(savon_response) ⇒ SimpleShipping::Abstract::Response
Wrap the Savon response with specific response for shipment provider.
16 17 18 |
# File 'lib/simple_shipping/abstract/request.rb', line 16 def response(savon_response) response_class.new(savon_response) end |
#response_class ⇒ Class
Response class to wrap Savon response.
23 24 25 |
# File 'lib/simple_shipping/abstract/request.rb', line 23 def response_class Response end |