Class: Mindee::Parsing::Standard::CompanyRegistrationField
- Inherits:
-
BaseField
- Object
- AbstractField
- BaseField
- Mindee::Parsing::Standard::CompanyRegistrationField
- Defined in:
- lib/mindee/parsing/standard/company_registration_field.rb
Overview
Company registration number or code, and its type.
Instance Attribute Summary collapse
- #type ⇒ String readonly
Attributes inherited from BaseField
Attributes inherited from AbstractField
#bounding_box, #confidence, #page_id, #polygon
Instance Method Summary collapse
-
#initialize(prediction, page_id, reconstructed: false) ⇒ CompanyRegistrationField
constructor
A new instance of CompanyRegistrationField.
-
#printable_values ⇒ Hash
Hashed representation of the values.
- #to_s ⇒ String
-
#to_table_line ⇒ String
Table line representation of the values.
Methods inherited from AbstractField
array_confidence, array_sum, float_to_string
Constructor Details
#initialize(prediction, page_id, reconstructed: false) ⇒ CompanyRegistrationField
Returns a new instance of CompanyRegistrationField.
14 15 16 17 |
# File 'lib/mindee/parsing/standard/company_registration_field.rb', line 14 def initialize(prediction, page_id, reconstructed: false) super @type = prediction['type'] end |
Instance Attribute Details
#type ⇒ String (readonly)
9 10 11 |
# File 'lib/mindee/parsing/standard/company_registration_field.rb', line 9 def type @type end |
Instance Method Details
#printable_values ⇒ Hash
Hashed representation of the values.
34 35 36 37 38 39 |
# File 'lib/mindee/parsing/standard/company_registration_field.rb', line 34 def printable_values printable = {} printable['type'] = type printable['value'] = value printable end |
#to_s ⇒ String
27 28 29 30 |
# File 'lib/mindee/parsing/standard/company_registration_field.rb', line 27 def to_s printable = printable_values format('Type: %<type>s, Value: %<value>s', type: printable['type'], value: printable['value']) end |
#to_table_line ⇒ String
Table line representation of the values.
21 22 23 24 |
# File 'lib/mindee/parsing/standard/company_registration_field.rb', line 21 def to_table_line printable = printable_values format('| %<type>-15s | %<value>-20s ', type: printable['type'], value: printable['value']) end |