Class: CliFormat::Presenter::Markdown

Inherits:
Space
  • Object
show all
Defined in:
lib/cli_format/presenter/markdown.rb

Instance Attribute Summary

Attributes inherited from Base

#empty_message, #header, #rows

Instance Method Summary collapse

Methods inherited from Space

#format_row, #max_widths

Methods inherited from Base

#initialize, #show

Constructor Details

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

Instance Method Details

#formatted_row_separatorObject

interface method



16
17
18
# File 'lib/cli_format/presenter/markdown.rb', line 16

def formatted_row_separator
  " | "
end

#textObject



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/cli_format/presenter/markdown.rb', line 3

def text
  if @header
    @buffer << format_row(@header, max_widths)
    second_line = @header.map { |h| "---" }
    @buffer << format_row(second_line, max_widths)
  end
  @rows.each do |row|
    @buffer << format_row(row, max_widths)
  end
  @buffer.join("\n")
end