Class: Mindee::Product::FR::EnergyBill::EnergyBillV1EnergySupplier

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

Overview

The company that supplies the energy.

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) ⇒ EnergyBillV1EnergySupplier

Returns a new instance of EnergyBillV1EnergySupplier.

Parameters:

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


21
22
23
24
25
26
# File 'lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_supplier.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

#addressString (readonly)

The address of the energy supplier.

Returns:

  • (String)


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

def address
  @address
end

#nameString (readonly)

The name of the energy supplier.

Returns:

  • (String)


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

def name
  @name
end

Instance Method Details

#printable_valuesHash

Returns:

  • (Hash)


29
30
31
32
33
34
# File 'lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_supplier.rb', line 29

def printable_values
  printable = {}
  printable[:address] = format_for_display(@address)
  printable[:name] = format_for_display(@name)
  printable
end

#to_sString

Returns:

  • (String)


37
38
39
40
41
42
43
# File 'lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_supplier.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