Class: Mindee::Parsing::Standard::CompanyRegistrationField
- Inherits:
-
Field
- Object
- AbstractField
- Field
- 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 Field
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 ⇒ Object
- #to_s ⇒ Object
- #to_table_line ⇒ Object
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 ⇒ Object
29 30 31 32 33 34 |
# File 'lib/mindee/parsing/standard/company_registration_field.rb', line 29 def printable_values printable = {} printable['type'] = type printable['value'] = value printable end |
#to_s ⇒ Object
24 25 26 27 |
# File 'lib/mindee/parsing/standard/company_registration_field.rb', line 24 def to_s printable = printable_values format('Type: %<type>s, Value: %<value>s', type: printable['type'], value: printable['value']) end |
#to_table_line ⇒ Object
19 20 21 22 |
# File 'lib/mindee/parsing/standard/company_registration_field.rb', line 19 def to_table_line printable = printable_values format('| %<type>-15s | %<value>-20s ', type: printable['type'], value: printable['value']) end |