Class: Mindee::Parsing::Common::WorkflowResponse
- Inherits:
-
Object
- Object
- Mindee::Parsing::Common::WorkflowResponse
- Defined in:
- lib/mindee/parsing/common/workflow_response.rb
Overview
Represents the server response after a document is sent to a workflow.
Instance Attribute Summary collapse
- #api_request ⇒ Mindee::Parsing::Common::ApiRequest readonly
-
#execution ⇒ Mindee::Parsing::Common::Execution
readonly
Set the prediction model used to parse the document.
- #raw_http ⇒ String readonly
Instance Method Summary collapse
-
#initialize(product_class, http_response, raw_http) ⇒ WorkflowResponse
constructor
A new instance of WorkflowResponse.
Constructor Details
#initialize(product_class, http_response, raw_http) ⇒ WorkflowResponse
Returns a new instance of WorkflowResponse.
19 20 21 22 23 24 |
# File 'lib/mindee/parsing/common/workflow_response.rb', line 19 def initialize(product_class, http_response, raw_http) @raw_http = raw_http.to_s @api_request = Mindee::Parsing::Common::ApiRequest.new(http_response['api_request']) product_class ||= Mindee::Product::Universal::Universal @execution = Mindee::Parsing::Common::Execution.new(product_class, http_response['execution']) end |
Instance Attribute Details
#api_request ⇒ Mindee::Parsing::Common::ApiRequest (readonly)
13 14 15 |
# File 'lib/mindee/parsing/common/workflow_response.rb', line 13 def api_request @api_request end |
#execution ⇒ Mindee::Parsing::Common::Execution (readonly)
Set the prediction model used to parse the document. The response object will be instantiated based on this parameter.
11 12 13 |
# File 'lib/mindee/parsing/common/workflow_response.rb', line 11 def execution @execution end |
#raw_http ⇒ String (readonly)
15 16 17 |
# File 'lib/mindee/parsing/common/workflow_response.rb', line 15 def raw_http @raw_http end |