Class: Mindee::V1::Parsing::Common::WorkflowResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/mindee/v1/parsing/common/workflow_response.rb

Overview

Represents the server response after a document is sent to a workflow.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(product_class, http_response, raw_http) ⇒ WorkflowResponse

Returns a new instance of WorkflowResponse.

Parameters:

  • http_response (Hash)
  • product_class (Mindee::Inference)


20
21
22
23
24
25
# File 'lib/mindee/v1/parsing/common/workflow_response.rb', line 20

def initialize(product_class, http_response, raw_http)
  @raw_http = raw_http.to_s
  @api_request = Mindee::V1::Parsing::Common::ApiRequest.new(http_response['api_request'])
  product_class ||= Mindee::V1::Product::Universal::Universal
  @execution = Mindee::V1::Parsing::Common::Execution.new(product_class, http_response['execution'])
end

Instance Attribute Details

#api_requestMindee::V1::Parsing::Common::ApiRequest (readonly)



14
15
16
# File 'lib/mindee/v1/parsing/common/workflow_response.rb', line 14

def api_request
  @api_request
end

#executionMindee::V1::Parsing::Common::Execution (readonly)

Set the prediction model used to parse the document. The response object will be instantiated based on this parameter.



12
13
14
# File 'lib/mindee/v1/parsing/common/workflow_response.rb', line 12

def execution
  @execution
end

#raw_httpString (readonly)

Returns:

  • (String)


16
17
18
# File 'lib/mindee/v1/parsing/common/workflow_response.rb', line 16

def raw_http
  @raw_http
end