class Mindee::Parsing::Standard::FeatureField

Feature field object wrapper for specialized methods.

def format_for_display(in_str, max_col_size = nil)

Returns:
  • (String) -

Parameters:
  • max_col_size (int, nil) --
  • in_str (String, bool, nil) --
def format_for_display(in_str, max_col_size = nil)
  return 'True' if in_str == true
  return 'False' if in_str == false
  return '' if in_str.nil?
  return in_str.to_s if max_col_size.nil?
  in_str = in_str.to_s.gsub(%r{[\n\r\t]}, "\n" => '\\n', "\r" => '\\r', "\t" => '\\t')
  in_str.to_s.length <= max_col_size.to_i ? in_str.to_s : "#{in_str[0..max_col_size.to_i - 4]}..."
end