Module: Formatter

Included in:
ConsoleFormatter
Defined in:
lib/formatter.rb

Instance Method Summary collapse

Instance Method Details

#render_each(records, format) ⇒ Object



2
3
4
5
6
# File 'lib/formatter.rb', line 2

def render_each records, format
  records.map { |record|
    render_record record, format
  }
end

#render_record(record, format) ⇒ Object



8
9
10
11
12
# File 'lib/formatter.rb', line 8

def render_record record, format
  format.merge(format) do |_, expression|
    record.instance_eval expression
  end
end