Class: Mindee::V1::Product::Universal::Universal

Inherits:
Mindee::V1::Parsing::Common::Inference show all
Defined in:
lib/mindee/v1/product/universal/universal.rb,
sig/mindee/v1/product/universal/universal.rbs

Overview

Universal Document V1 prediction inference.

Class Attribute Summary collapse

Attributes inherited from Mindee::V1::Parsing::Common::Inference

#extras, #is_rotation_applied, #pages, #prediction, #product

Instance Method Summary collapse

Methods inherited from Mindee::V1::Parsing::Common::Inference

#to_s

Constructor Details

#initialize(prediction) ⇒ Universal

Returns a new instance of Universal.

Parameters:



19
20
21
22
23
24
25
26
27
28
# File 'lib/mindee/v1/product/universal/universal.rb', line 19

def initialize(prediction)
  super
  @prediction = UniversalDocument.new(prediction['prediction'])
  @pages = [] # : Array[Mindee::V1::Parsing::Common::Page]
  prediction['pages'].each do |page|
    if page.key?('prediction') && !page['prediction'].nil? && !page['prediction'].empty?
      @pages.push(UniversalPage.new(page))
    end
  end
end

Class Attribute Details

.endpoint_nameString (readonly)

Name of the endpoint for this product.

Returns:



33
34
35
# File 'lib/mindee/v1/product/universal/universal.rb', line 33

def endpoint_name
  @endpoint_name
end

.endpoint_versionString (readonly)

Version for this product.

Returns:



36
37
38
# File 'lib/mindee/v1/product/universal/universal.rb', line 36

def endpoint_version
  @endpoint_version
end

.has_asyncbool (readonly)

Whether this product has access to an asynchronous endpoint.

Returns:



39
40
41
# File 'lib/mindee/v1/product/universal/universal.rb', line 39

def has_async
  @has_async
end

.has_syncbool (readonly)

Whether this product has access to synchronous endpoint.

Returns:



42
43
44
# File 'lib/mindee/v1/product/universal/universal.rb', line 42

def has_sync
  @has_sync
end

Instance Method Details

#endpoint_nameString

Returns:



8
# File 'sig/mindee/v1/product/universal/universal.rbs', line 8

def endpoint_name: -> String

#endpoint_versionString

Returns:



9
# File 'sig/mindee/v1/product/universal/universal.rbs', line 9

def endpoint_version: -> String

#has_asyncBoolean

Returns:



10
# File 'sig/mindee/v1/product/universal/universal.rbs', line 10

def has_async: -> bool

#has_syncBoolean

Returns:



11
# File 'sig/mindee/v1/product/universal/universal.rbs', line 11

def has_sync: -> bool