Class: Mindee::Parsing::Standard::StringField

Inherits:
Field show all
Defined in:
lib/mindee/parsing/standard/string_field.rb

Overview

Represents basic text information.

Instance Attribute Summary collapse

Attributes inherited from Field

#reconstructed

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 = nil, reconstructed: false) ⇒ StringField

Returns a new instance of StringField.



17
18
19
20
# File 'lib/mindee/parsing/standard/string_field.rb', line 17

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

Instance Attribute Details

#raw_valueString? (readonly)

Value as String

Returns:

  • (String, nil)


15
16
17
# File 'lib/mindee/parsing/standard/string_field.rb', line 15

def raw_value
  @raw_value
end

#valueString? (readonly)

Value as String

Returns:

  • (String, nil)


12
13
14
# File 'lib/mindee/parsing/standard/string_field.rb', line 12

def value
  @value
end