Class: Mindee::Product::FR::EnergyBill::EnergyBillV1MeterDetail

Inherits:
Mindee::Parsing::Standard::FeatureField show all
Includes:
Mindee::Parsing::Standard
Defined in:
lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb

Overview

Information about the energy meter.

Instance Attribute Summary collapse

Attributes inherited from Mindee::Parsing::Standard::AbstractField

#bounding_box, #confidence, #page_id, #polygon

Instance Method Summary collapse

Methods inherited from Mindee::Parsing::Standard::FeatureField

#format_for_display

Methods inherited from Mindee::Parsing::Standard::AbstractField

array_confidence, array_sum, float_to_string

Constructor Details

#initialize(prediction, page_id) ⇒ EnergyBillV1MeterDetail

Returns a new instance of EnergyBillV1MeterDetail.

Parameters:

  • prediction (Hash)
  • page_id (Integer, nil)


24
25
26
27
28
29
30
# File 'lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb', line 24

def initialize(prediction, page_id)
  super(prediction, page_id)
  @meter_number = prediction['meter_number']
  @meter_type = prediction['meter_type']
  @unit = prediction['unit']
  @page_id = page_id
end

Instance Attribute Details

#meter_numberString (readonly)

The unique identifier of the energy meter.

Returns:

  • (String)


14
15
16
# File 'lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb', line 14

def meter_number
  @meter_number
end

#meter_typeString (readonly)

The type of energy meter.

Returns:

  • (String)


17
18
19
# File 'lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb', line 17

def meter_type
  @meter_type
end

#unitString (readonly)

The unit of measurement for energy consumption, which can be kW, m³, or L.

Returns:

  • (String)


20
21
22
# File 'lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb', line 20

def unit
  @unit
end

Instance Method Details

#printable_valuesHash

Returns:

  • (Hash)


33
34
35
36
37
38
39
# File 'lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb', line 33

def printable_values
  printable = {}
  printable[:meter_number] = format_for_display(@meter_number)
  printable[:meter_type] = format_for_display(@meter_type)
  printable[:unit] = format_for_display(@unit)
  printable
end

#to_sString

Returns:

  • (String)


42
43
44
45
46
47
48
49
# File 'lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb', line 42

def to_s
  printable = printable_values
  out_str = String.new
  out_str << "\n  :Meter Number: #{printable[:meter_number]}"
  out_str << "\n  :Meter Type: #{printable[:meter_type]}"
  out_str << "\n  :Unit of Measure: #{printable[:unit]}"
  out_str
end