Class: Mindee::Product::US::HealthcareCard::HealthcareCardV1Copay

Inherits:
Mindee::Parsing::Standard::FeatureField show all
Includes:
Mindee::Parsing::Standard
Defined in:
lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb

Overview

Is a fixed amount for a covered service.

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

Returns a new instance of HealthcareCardV1Copay.

Parameters:

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


21
22
23
24
25
26
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb', line 21

def initialize(prediction, page_id)
  super(prediction, page_id)
  @service_fees = prediction['service_fees']
  @service_name = prediction['service_name']
  @page_id = page_id
end

Instance Attribute Details

#service_feesFloat (readonly)

The price of service.

Returns:

  • (Float)


14
15
16
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb', line 14

def service_fees
  @service_fees
end

#service_nameString (readonly)

The name of service of the copay.

Returns:

  • (String)


17
18
19
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb', line 17

def service_name
  @service_name
end

Instance Method Details

#printable_valuesHash

Returns:

  • (Hash)


29
30
31
32
33
34
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb', line 29

def printable_values
  printable = {}
  printable[:service_fees] = @service_fees.nil? ? '' : Field.float_to_string(@service_fees)
  printable[:service_name] = format_for_display(@service_name)
  printable
end

#table_printable_valuesHash

Returns:

  • (Hash)


37
38
39
40
41
42
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb', line 37

def table_printable_values
  printable = {}
  printable[:service_fees] = @service_fees.nil? ? '' : Field.float_to_string(@service_fees)
  printable[:service_name] = format_for_display(@service_name, nil)
  printable
end

#to_sString

Returns:

  • (String)


54
55
56
57
58
59
60
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb', line 54

def to_s
  printable = printable_values
  out_str = String.new
  out_str << "\n  :Service Fees: #{printable[:service_fees]}"
  out_str << "\n  :Service Name: #{printable[:service_name]}"
  out_str
end

#to_table_lineString

Returns:

  • (String)


45
46
47
48
49
50
51
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb', line 45

def to_table_line
  printable = table_printable_values
  out_str = String.new
  out_str << format('| %- 13s', printable[:service_fees])
  out_str << format('| %- 13s', printable[:service_name])
  out_str << '|'
end