Class: Fulfillment::Request
- Inherits:
-
Object
- Object
- Fulfillment::Request
- Defined in:
- lib/fulfillment/request.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #call(method) ⇒ Object
-
#initialize(path, params = {}) ⇒ Request
constructor
A new instance of Request.
- #uri ⇒ Object
Constructor Details
#initialize(path, params = {}) ⇒ Request
Returns a new instance of Request.
7 8 9 10 |
# File 'lib/fulfillment/request.rb', line 7 def initialize(path, params={}) @path = path @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'lib/fulfillment/request.rb', line 5 def params @params end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/fulfillment/request.rb', line 5 def path @path end |
Instance Method Details
#call(method) ⇒ Object
12 13 14 15 |
# File 'lib/fulfillment/request.rb', line 12 def call(method) response = client.public_send(method, uri, params) response.on_error(&:raise_errors) end |
#uri ⇒ Object
23 24 25 |
# File 'lib/fulfillment/request.rb', line 23 def uri @uri ||= build_uri end |