class TablePrint::Config

Constants

DEFAULT_CAPITALIZE_HEADERS
DEFAULT_IO
DEFAULT_MAX_WIDTH
DEFAULT_SEPARATOR
DEFAULT_TIME_FORMAT

Public Class Methods

capitalize_headers() click to toggle source
# File lib/table_print/config.rb, line 64
def self.capitalize_headers
  @@capitalize_headers
end
capitalize_headers=(caps) click to toggle source
# File lib/table_print/config.rb, line 68
def self.capitalize_headers=(caps)
  @@capitalize_headers = caps
end
clear(klass) click to toggle source
# File lib/table_print/config.rb, line 31
def self.clear(klass)
  if klass.is_a? Class
    @@klasses.delete(klass)
  else
    original_value = TablePrint::Config.const_get("DEFAULT_#{klass.to_s.upcase}")
    TablePrint::Config.send("#{klass}=", original_value)
  end
end
for(klass) click to toggle source
# File lib/table_print/config.rb, line 27
def self.for(klass)
  @@klasses.fetch(klass) {}
end
io() click to toggle source
# File lib/table_print/config.rb, line 80
def self.io
  @@io
end
io=(io) click to toggle source
# File lib/table_print/config.rb, line 84
def self.io=(io)
  raise StandardError.new("IO object must respond to :puts") unless io.respond_to? :puts
  @@io = io
end
max_width() click to toggle source
# File lib/table_print/config.rb, line 40
def self.max_width
  @@max_width
end
max_width=(width) click to toggle source
# File lib/table_print/config.rb, line 44
def self.max_width=(width)
  @@max_width = width
end
multibyte() click to toggle source
# File lib/table_print/config.rb, line 48
def self.multibyte
  @@multibyte
end
multibyte=(width) click to toggle source
# File lib/table_print/config.rb, line 52
def self.multibyte=(width)
  @@multibyte = width
end
separator() click to toggle source
# File lib/table_print/config.rb, line 72
def self.separator
  @@separator
end
separator=(separator) click to toggle source
# File lib/table_print/config.rb, line 76
def self.separator=(separator)
  @@separator = separator
end
set(klass, val) click to toggle source
# File lib/table_print/config.rb, line 19
def self.set(klass, val)
  if klass.is_a? Class
    @@klasses[klass] = val  # val is a hash of column options
  else
    TablePrint::Config.send("#{klass}=", val.first)
  end
end
time_format() click to toggle source
# File lib/table_print/config.rb, line 56
def self.time_format
  @@time_format
end
time_format=(format) click to toggle source
# File lib/table_print/config.rb, line 60
def self.time_format=(format)
  @@time_format = format
end