Class: ConsoleFormatter

Inherits:
Struct
  • Object
show all
Includes:
Formatter
Defined in:
lib/console_formatter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Formatter

#render_each, #render_record

Instance Attribute Details

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



1
2
3
# File 'lib/console_formatter.rb', line 1

def format
  @format
end

Instance Method Details

#present(records) ⇒ Object



4
5
6
# File 'lib/console_formatter.rb', line 4

def present records
  Hirb::Helpers::AutoTable.render(render_each(records, format), fields: format.keys, resize: false)
end