Class: Mindee::V2::Product::Classification::ClassificationResponse

Inherits:
Mindee::V2::Parsing::BaseResponse show all
Defined in:
lib/mindee/v2/product/classification/classification_response.rb,
sig/mindee/v2/product/classification/classification_response.rbs

Overview

HTTP response wrapper that embeds a V2 Inference.

Instance Attribute Summary collapse

Attributes inherited from Mindee::V2::Parsing::CommonResponse

#raw_http

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_response) ⇒ ClassificationResponse

Returns a new instance of ClassificationResponse.

Parameters:

  • Hash parsed from the API JSON response.



17
18
19
20
21
# File 'lib/mindee/v2/product/classification/classification_response.rb', line 17

def initialize(server_response)
  super

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

Instance Attribute Details

#inferenceClassificationInference (readonly)

Returns Parsed inference payload.

Returns:

  • Parsed inference payload.



14
15
16
# File 'lib/mindee/v2/product/classification/classification_response.rb', line 14

def inference
  @inference
end

Class Method Details

._params_typesingleton(Params::ClassificationParameters)

Returns:



17
# File 'sig/mindee/v2/product/classification/classification_response.rbs', line 17

def self._params_type: () -> singleton(Params::ClassificationParameters)

.slugString

Returns:



18
# File 'sig/mindee/v2/product/classification/classification_response.rbs', line 18

def self.slug: () -> String

Instance Method Details

#_params_typesingleton(Params::ClassificationParameters)

Returns:



14
# File 'sig/mindee/v2/product/classification/classification_response.rbs', line 14

def _params_type: -> singleton(Params::ClassificationParameters)

#to_sString

String representation.

Returns:



25
26
27
# File 'lib/mindee/v2/product/classification/classification_response.rb', line 25

def to_s
  @inference.to_s
end