Class: Mindee::V2::Product::Split::SplitResult

Inherits:
Object
  • Object
show all
Defined in:
lib/mindee/v2/product/split/split_result.rb

Overview

Result of a split utility inference.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_response) ⇒ SplitResult

Returns a new instance of SplitResult.

Parameters:

  • server_response (Hash)

    Hash representation of the JSON returned by the service.



15
16
17
18
19
20
21
# File 'lib/mindee/v2/product/split/split_result.rb', line 15

def initialize(server_response)
  @splits = if server_response.key?('splits')
              server_response['splits'].map do |split|
                SplitRange.new(split)
              end
            end
end

Instance Attribute Details

#splitsArray<SplitRange> (readonly)

Returns List of results of splitped document regions.

Returns:

  • (Array<SplitRange>)

    List of results of splitped document regions.



12
13
14
# File 'lib/mindee/v2/product/split/split_result.rb', line 12

def splits
  @splits
end

Instance Method Details

#to_sString

String representation.

Returns:

  • (String)


25
26
27
28
29
# File 'lib/mindee/v2/product/split/split_result.rb', line 25

def to_s
  splits_str = @splits.join("\n")

  "Splits\n======\n#{splits_str}"
end