Sha256: fd0505579360d9dab0add55f2b0208eafdff4e72fdb34d2381982bff39cac5f8
Contents?: true
Size: 422 Bytes
Versions: 8
Compression:
Stored size: 422 Bytes
Contents
class ConsoleFormatter < Struct.new :format def present records, format = format Hirb::Helpers::AutoTable.render(render_each(records), fields: format.keys, resize: false) end def render_each records records.map { |record| render_record record } end def render_record record, format = format format.merge(format) do |_, expression| record.instance_eval expression end end end
Version data entries
8 entries across 8 versions & 1 rubygems