Class: Mindee::Parsing::Standard::Taxes
- Inherits:
-
Array
- Object
- Array
- Mindee::Parsing::Standard::Taxes
- Defined in:
- lib/mindee/parsing/standard/tax_field.rb
Overview
Represents tax information, grouped as an array.
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ Taxes
constructor
A new instance of Taxes.
- #line_separator(char) ⇒ String
- #to_s ⇒ String
Constructor Details
Instance Method Details
#line_separator(char) ⇒ String
81 82 83 84 85 86 87 88 89 90 |
# File 'lib/mindee/parsing/standard/tax_field.rb', line 81 def line_separator(char) out_str = String.new out_str << ' ' out_str << "+#{char * 15}" out_str << "+#{char * 8}" out_str << "+#{char * 10}" out_str << "+#{char * 15}" out_str << '+' out_str end |
#to_s ⇒ String
93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/mindee/parsing/standard/tax_field.rb', line 93 def to_s return '' if nil? || empty? out_str = String.new out_str << ("\n#{line_separator('-')}") out_str << "\n | Base | Code | Rate (%) | Amount |" out_str << "\n#{line_separator('=')}" each do |entry| out_str << "\n #{entry.to_table_line}\n#{line_separator('-')}" end out_str end |