Class: Mindee::V2::Product::Extraction::ExtractionInference

Inherits:
Mindee::V2::Parsing::BaseInference show all
Defined in:
lib/mindee/v2/product/extraction/extraction_inference.rb

Overview

Extraction inference.

Instance Attribute Summary collapse

Attributes inherited from Mindee::V2::Parsing::BaseInference

#file, #id, #job, #model

Instance Method Summary collapse

Constructor Details

#initialize(server_response) ⇒ ExtractionInference

Returns a new instance of ExtractionInference.

Parameters:

  • server_response (Hash)

    Hash representation of the JSON returned by the service.



19
20
21
22
23
24
# File 'lib/mindee/v2/product/extraction/extraction_inference.rb', line 19

def initialize(server_response)
  super

  @active_options = V2::Parsing::InferenceActiveOptions.new(server_response['active_options'])
  @result = ExtractionResult.new(server_response['result'])
end

Instance Attribute Details

#active_optionsInferenceActiveOptions (readonly)

Returns Options which were activated during the inference.

Returns:

  • (InferenceActiveOptions)

    Options which were activated during the inference.



14
15
16
# File 'lib/mindee/v2/product/extraction/extraction_inference.rb', line 14

def active_options
  @active_options
end

#resultExtractionResult (readonly)

Returns Result contents.

Returns:



16
17
18
# File 'lib/mindee/v2/product/extraction/extraction_inference.rb', line 16

def result
  @result
end

Instance Method Details

#to_sString

String representation.

Returns:

  • (String)


28
29
30
31
32
33
34
35
# File 'lib/mindee/v2/product/extraction/extraction_inference.rb', line 28

def to_s
  [
    super,
    @active_options.to_s,
    @result.to_s,
    '',
  ].join("\n")
end