Class: Mindee::Product::US::HealthcareCard::HealthcareCardV1Copay
- Inherits:
-
Mindee::Parsing::Standard::FeatureField
- Object
- Mindee::Parsing::Standard::AbstractField
- Mindee::Parsing::Standard::FeatureField
- Mindee::Product::US::HealthcareCard::HealthcareCardV1Copay
- 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
-
#service_fees ⇒ Float
readonly
The price of service.
-
#service_name ⇒ String
readonly
The name of service of the copay.
Attributes inherited from Mindee::Parsing::Standard::AbstractField
#bounding_box, #confidence, #page_id, #polygon
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ HealthcareCardV1Copay
constructor
A new instance of HealthcareCardV1Copay.
- #printable_values ⇒ Hash
- #table_printable_values ⇒ Hash
- #to_s ⇒ String
- #to_table_line ⇒ 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) ⇒ HealthcareCardV1Copay
Returns a new instance of HealthcareCardV1Copay.
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_fees ⇒ Float (readonly)
The price of service.
14 15 16 |
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb', line 14 def service_fees @service_fees end |
#service_name ⇒ String (readonly)
The name of service of the copay.
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_values ⇒ 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_values ⇒ 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_s ⇒ 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_line ⇒ 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 |