Class: Mindee::Product::US::HealthcareCard::HealthcareCardV1Copays
- Inherits:
-
Array
- Object
- Array
- Mindee::Product::US::HealthcareCard::HealthcareCardV1Copays
- Defined in:
- lib/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rb
Overview
Is a fixed amount for a covered service.
Instance Attribute Summary collapse
-
#entries ⇒ Array<HealthcareCardV1Copay>
readonly
Entries.
Class Method Summary collapse
-
.line_items_separator(char) ⇒ String
Creates a line of rST table-compliant string separators.
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ HealthcareCardV1Copays
constructor
A new instance of HealthcareCardV1Copays.
- #to_s ⇒ String
Constructor Details
#initialize(prediction, page_id) ⇒ HealthcareCardV1Copays
Returns a new instance of HealthcareCardV1Copays.
17 18 19 20 21 22 |
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rb', line 17 def initialize(prediction, page_id) entries = prediction.map do |entry| HealthcareCard::HealthcareCardV1Copay.new(entry, page_id) end super(entries) end |
Instance Attribute Details
#entries ⇒ Array<HealthcareCardV1Copay> (readonly)
Entries.
13 14 15 |
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rb', line 13 def entries @entries end |
Class Method Details
.line_items_separator(char) ⇒ String
Creates a line of rST table-compliant string separators.
27 28 29 30 31 32 |
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rb', line 27 def self.line_items_separator(char) out_str = String.new out_str << "+#{char * 14}" out_str << "+#{char * 14}" out_str end |
Instance Method Details
#to_s ⇒ String
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rb', line 35 def to_s return '' if empty? lines = map do |entry| "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}" end.join out_str = String.new out_str << ("\n#{self.class.line_items_separator('-')}\n ") out_str << ' | Service Fees' out_str << ' | Service Name' out_str << (" |\n#{self.class.line_items_separator('=')}") out_str + lines end |