class Mindee::Parsing::Standard::Taxes

Represents tax information, grouped as an array.

def initialize(prediction, page_id)

Parameters:
  • page_id (Integer, nil) --
  • prediction (Hash) --
def initialize(prediction, page_id)
  super(prediction.map { |entry| TaxField.new(entry, page_id) })
end

def line_separator(char)

Returns:
  • (String) -

Parameters:
  • char (String) --
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

def to_s

Returns:
  • (String) -
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