Class: Mindee::V2::Product::Classification::ClassificationClassifier

Inherits:
Object
  • Object
show all
Defined in:
lib/mindee/v2/product/classification/classification_classifier.rb

Overview

Classification of document type from the source file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_response) ⇒ ClassificationClassifier

Returns a new instance of ClassificationClassifier.

Parameters:

  • server_response (Hash)

    Hash representation of the JSON returned by the service.



14
15
16
17
18
19
20
21
# File 'lib/mindee/v2/product/classification/classification_classifier.rb', line 14

def initialize(server_response)
  @document_type = server_response['document_type']
  # rubocop:disable Style/GuardClause
  unless server_response['extraction_response'].nil?
    @extraction_response = V2::Product::Extraction::ExtractionResponse.new(server_response['extraction_response'])
  end
  # rubocop:enable Style/GuardClause
end

Instance Attribute Details

#document_typeString (readonly)

Returns The document type, as identified on given classification values.

Returns:

  • (String)

    The document type, as identified on given classification values.



10
11
12
# File 'lib/mindee/v2/product/classification/classification_classifier.rb', line 10

def document_type
  @document_type
end

#extraction_responseObject (readonly)

Returns the value of attribute extraction_response.



11
12
13
# File 'lib/mindee/v2/product/classification/classification_classifier.rb', line 11

def extraction_response
  @extraction_response
end

Instance Method Details

#to_sString

Returns String representation.

Returns:

  • (String)

    String representation.



24
25
26
# File 'lib/mindee/v2/product/classification/classification_classifier.rb', line 24

def to_s
  "Document Type: #{@document_type}"
end