Class: CliFormat::Presenter::Csv

Inherits:
Base
  • Object
show all
Defined in:
lib/cli_format/presenter/csv.rb

Instance Attribute Summary

Attributes inherited from Base

#empty_message, #header, #rows

Instance Method Summary collapse

Methods inherited from Base

#initialize, #show

Constructor Details

This class inherits a constructor from CliFormat::Presenter::Base

Instance Method Details

#textObject



5
6
7
8
9
10
11
12
# File 'lib/cli_format/presenter/csv.rb', line 5

def text
  CSV.generate do |csv|
    csv << @header if @header
    @rows.each do |row|
      csv << row
    end
  end
end