Class: Smartsheet::API::Request
- Inherits:
-
Object
- Object
- Smartsheet::API::Request
- Defined in:
- lib/smartsheet/api/request.rb
Overview
Full specification for a single request to an endpoint
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(token, endpoint_spec, request_spec, base_url, assume_user: nil) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(token, endpoint_spec, request_spec, base_url, assume_user: nil) ⇒ Request
Returns a new instance of Request.
11 12 13 14 15 16 17 |
# File 'lib/smartsheet/api/request.rb', line 11 def initialize(token, endpoint_spec, request_spec, base_url, assume_user: nil) @method = endpoint_spec.method @url = Smartsheet::API::UrlBuilder.new(endpoint_spec, request_spec, base_url).build @headers = Smartsheet::API::HeaderBuilder.new(token, endpoint_spec, request_spec, assume_user: assume_user).build @params = request_spec.params @body = Smartsheet::API::BodyBuilder.new(endpoint_spec, request_spec).build end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
9 10 11 |
# File 'lib/smartsheet/api/request.rb', line 9 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
9 10 11 |
# File 'lib/smartsheet/api/request.rb', line 9 def headers @headers end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
9 10 11 |
# File 'lib/smartsheet/api/request.rb', line 9 def method @method end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
9 10 11 |
# File 'lib/smartsheet/api/request.rb', line 9 def params @params end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
9 10 11 |
# File 'lib/smartsheet/api/request.rb', line 9 def url @url end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 |
# File 'lib/smartsheet/api/request.rb', line 19 def ==(other) other.class == self.class && other.equality_state == equality_state end |