Class: Orchestrate::API::Response::Header
- Inherits:
-
Object
- Object
- Orchestrate::API::Response::Header
- Defined in:
- lib/orchestrate_api/response.rb
Overview
Provides methods for ready access to relevant information extracted from the HTTParty response headers.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
HTTP response code.
-
#content ⇒ Object
readonly
Original response headers from HTTParty.
-
#etag ⇒ Object
readonly
ETag value, also known as the ‘ref’ value.
-
#link ⇒ Object
readonly
Link to the next url in a series of list requests.
-
#status ⇒ Object
readonly
HTTP response status.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(headers, code, msg) ⇒ Header
constructor
A new instance of Header.
Constructor Details
#initialize(headers, code, msg) ⇒ Header
Returns a new instance of Header.
49 50 51 52 53 54 55 |
# File 'lib/orchestrate_api/response.rb', line 49 def initialize(headers, code, msg) @content = headers @code, @status = code, msg @timestamp = headers['date'] @etag = headers['etag'] if headers['etag'] @link = headers['link'] if headers['link'] end |
Instance Attribute Details
#code ⇒ Object (readonly)
HTTP response code.
36 37 38 |
# File 'lib/orchestrate_api/response.rb', line 36 def code @code end |
#content ⇒ Object (readonly)
Original response headers from HTTParty.
33 34 35 |
# File 'lib/orchestrate_api/response.rb', line 33 def content @content end |
#etag ⇒ Object (readonly)
ETag value, also known as the ‘ref’ value.
44 45 46 |
# File 'lib/orchestrate_api/response.rb', line 44 def etag @etag end |
#link ⇒ Object (readonly)
Link to the next url in a series of list requests.
47 48 49 |
# File 'lib/orchestrate_api/response.rb', line 47 def link @link end |
#status ⇒ Object (readonly)
HTTP response status.
39 40 41 |
# File 'lib/orchestrate_api/response.rb', line 39 def status @status end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
41 42 43 |
# File 'lib/orchestrate_api/response.rb', line 41 def @timestamp end |