Class: Mindee::V1::Parsing::Standard::BaseField

Inherits:
AbstractField show all
Defined in:
lib/mindee/v1/parsing/standard/base_field.rb,
sig/mindee/v1/parsing/standard/base_field.rbs

Overview

Base field object.

Instance Attribute Summary collapse

Attributes inherited from AbstractField

#bounding_box, #confidence, #page_id, #polygon

Instance Method Summary collapse

Methods inherited from AbstractField

array_confidence, array_sum, float_to_string, #to_s

Constructor Details

#initialize(prediction, page_id, reconstructed: false) ⇒ BaseField

Returns a new instance of BaseField.

Parameters:

  • (defaults to: false)
  • (defaults to: false)


21
22
23
24
25
# File 'lib/mindee/v1/parsing/standard/base_field.rb', line 21

def initialize(prediction, page_id, reconstructed: false)
  super(prediction, page_id)
  @value = prediction['value']
  @reconstructed = reconstructed
end

Instance Attribute Details

#reconstructedbool (readonly)

true if the field was reconstructed or computed using other fields.

Returns:



16
17
18
# File 'lib/mindee/v1/parsing/standard/base_field.rb', line 16

def reconstructed
  @reconstructed
end

#valueString, ... (readonly)

Returns:



13
14
15
# File 'lib/mindee/v1/parsing/standard/base_field.rb', line 13

def value
  @value
end