Class: Restspec::Endpoints::Request
- Inherits:
-
Struct
- Object
- Struct
- Restspec::Endpoints::Request
- Defined in:
- lib/restspec/endpoints/request.rb
Overview
A bag for request data.
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
Allows to set the endpoint used to generate this request.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#method ⇒ Object
Returns the value of attribute method.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#raw_payload ⇒ String
A json encoded payload.
Instance Attribute Details
#endpoint ⇒ Object
Allows to set the endpoint used to generate this request.
6 7 8 |
# File 'lib/restspec/endpoints/request.rb', line 6 def endpoint @endpoint end |
#headers ⇒ Object
Returns the value of attribute headers
4 5 6 |
# File 'lib/restspec/endpoints/request.rb', line 4 def headers @headers end |
#method ⇒ Object
Returns the value of attribute method
4 5 6 |
# File 'lib/restspec/endpoints/request.rb', line 4 def method @method end |
#payload ⇒ Object
Returns the value of attribute payload
4 5 6 |
# File 'lib/restspec/endpoints/request.rb', line 4 def payload @payload end |
#url ⇒ Object
Returns the value of attribute url
4 5 6 |
# File 'lib/restspec/endpoints/request.rb', line 4 def url @url end |
Instance Method Details
#raw_payload ⇒ String
Returns a json encoded payload.
9 10 11 |
# File 'lib/restspec/endpoints/request.rb', line 9 def raw_payload @raw_payload ||= (payload || '').to_json end |