Class: Mindee::Product::FR::EnergyBill::EnergyBillV1EnergyConsumer
- Inherits:
-
Mindee::Parsing::Standard::FeatureField
- Object
- Mindee::Parsing::Standard::AbstractField
- Mindee::Parsing::Standard::FeatureField
- Mindee::Product::FR::EnergyBill::EnergyBillV1EnergyConsumer
- Includes:
- Mindee::Parsing::Standard
- Defined in:
- lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rb
Overview
The entity that consumes the energy.
Instance Attribute Summary collapse
-
#address ⇒ String
readonly
The address of the energy consumer.
-
#name ⇒ String
readonly
The name of the energy consumer.
Attributes inherited from Mindee::Parsing::Standard::AbstractField
#bounding_box, #confidence, #page_id, #polygon
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ EnergyBillV1EnergyConsumer
constructor
A new instance of EnergyBillV1EnergyConsumer.
- #printable_values ⇒ Hash
- #to_s ⇒ String
Methods inherited from Mindee::Parsing::Standard::FeatureField
Methods inherited from Mindee::Parsing::Standard::AbstractField
array_confidence, array_sum, float_to_string
Constructor Details
#initialize(prediction, page_id) ⇒ EnergyBillV1EnergyConsumer
Returns a new instance of EnergyBillV1EnergyConsumer.
21 22 23 24 25 26 |
# File 'lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rb', line 21 def initialize(prediction, page_id) super(prediction, page_id) @address = prediction['address'] @name = prediction['name'] @page_id = page_id end |
Instance Attribute Details
#address ⇒ String (readonly)
The address of the energy consumer.
14 15 16 |
# File 'lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rb', line 14 def address @address end |
#name ⇒ String (readonly)
The name of the energy consumer.
17 18 19 |
# File 'lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rb', line 17 def name @name end |
Instance Method Details
#printable_values ⇒ Hash
29 30 31 32 33 34 |
# File 'lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rb', line 29 def printable_values printable = {} printable[:address] = format_for_display(@address) printable[:name] = format_for_display(@name) printable end |
#to_s ⇒ String
37 38 39 40 41 42 43 |
# File 'lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rb', line 37 def to_s printable = printable_values out_str = String.new out_str << "\n :Address: #{printable[:address]}" out_str << "\n :Name: #{printable[:name]}" out_str end |