class Bl::Formatter
Constants
- TPUT_COLS
Public Class Methods
new(format: 'table')
click to toggle source
# File lib/bl/formatter.rb, line 9 def initialize(format: 'table') @format = case format when 'table' Format::Hirb when 'json' Format::Json else abort 'format must be set to \'table\' or \'json\'' end end
Public Instance Methods
render(*args)
click to toggle source
# File lib/bl/formatter.rb, line 20 def render(*args) @format.render(args[0], args[1].merge(max_width: TPUT_COLS)) end