Class: ElephantInTheRoom::TheOneApiSdk::Pipeline::ResponseBody
- Inherits:
-
Object
- Object
- ElephantInTheRoom::TheOneApiSdk::Pipeline::ResponseBody
- Defined in:
- lib/elephant_in_the_room/the_one_api_sdk/pipeline/response_body.rb
Overview
Pipeline stage to get body content from HTTP response
Instance Method Summary collapse
- #execute_http_request(request_details) ⇒ Object
- #http_body ⇒ Object
-
#initialize(next_pipeline_stage) ⇒ ResponseBody
constructor
A new instance of ResponseBody.
Constructor Details
#initialize(next_pipeline_stage) ⇒ ResponseBody
Returns a new instance of ResponseBody.
7 8 9 |
# File 'lib/elephant_in_the_room/the_one_api_sdk/pipeline/response_body.rb', line 7 def initialize(next_pipeline_stage) @next_pipeline_stage = next_pipeline_stage end |
Instance Method Details
#execute_http_request(request_details) ⇒ Object
11 12 13 |
# File 'lib/elephant_in_the_room/the_one_api_sdk/pipeline/response_body.rb', line 11 def execute_http_request(request_details) @next_pipeline_stage.execute_http_request(request_details) end |
#http_body ⇒ Object
15 16 17 18 19 20 |
# File 'lib/elephant_in_the_room/the_one_api_sdk/pipeline/response_body.rb', line 15 def http_body body = @next_pipeline_stage.http_response.body raise ElephantInTheRoom::TheOneApiSdk::Errors::NoContentError, "Server response was empty" if body.empty? body end |