Class: Mindee::Parsing::Standard::AmountField
- Inherits:
-
Field
- Object
- AbstractField
- Field
- Mindee::Parsing::Standard::AmountField
- Defined in:
- lib/mindee/parsing/standard/amount_field.rb
Overview
Represents tax information.
Instance Attribute Summary collapse
-
#value ⇒ Float?
readonly
Amount value as 3 decimal float.
Attributes inherited from Field
Attributes inherited from AbstractField
#bounding_box, #confidence, #page_id, #polygon
Instance Method Summary collapse
-
#initialize(prediction, page_id, reconstructed: false) ⇒ AmountField
constructor
A new instance of AmountField.
- #to_s ⇒ String
Methods inherited from AbstractField
array_confidence, array_sum, float_to_string
Constructor Details
#initialize(prediction, page_id, reconstructed: false) ⇒ AmountField
Returns a new instance of AmountField.
14 15 16 17 |
# File 'lib/mindee/parsing/standard/amount_field.rb', line 14 def initialize(prediction, page_id, reconstructed: false) super @value = @value.round(3) unless @value.nil? end |
Instance Attribute Details
#value ⇒ Float? (readonly)
Amount value as 3 decimal float
12 13 14 |
# File 'lib/mindee/parsing/standard/amount_field.rb', line 12 def value @value end |
Instance Method Details
#to_s ⇒ String
20 21 22 |
# File 'lib/mindee/parsing/standard/amount_field.rb', line 20 def to_s Field.float_to_string(@value) end |