Class: Mindee::Parsing::V2::InferenceResponse

Inherits:
CommonResponse show all
Defined in:
lib/mindee/parsing/v2/inference_response.rb

Overview

HTTP response wrapper that embeds a V2 Inference.

Instance Attribute Summary collapse

Attributes inherited from CommonResponse

#raw_http

Instance Method Summary collapse

Constructor Details

#initialize(server_response) ⇒ InferenceResponse

Returns a new instance of InferenceResponse.

Parameters:

  • server_response (Hash)

    Hash parsed from the API JSON response.



15
16
17
18
19
20
# File 'lib/mindee/parsing/v2/inference_response.rb', line 15

def initialize(server_response)
  # CommonResponse takes care of the generic metadata (status, etc.)
  super

  @inference = Inference.new(server_response['inference'])
end

Instance Attribute Details

#inferenceInference (readonly)

Returns Parsed inference payload.

Returns:



12
13
14
# File 'lib/mindee/parsing/v2/inference_response.rb', line 12

def inference
  @inference
end

Instance Method Details

#to_sString

String representation.

Returns:

  • (String)


24
25
26
# File 'lib/mindee/parsing/v2/inference_response.rb', line 24

def to_s
  @inference.to_s
end