Class: CliFormat::Presenter::Markdown
- Defined in:
- lib/cli_format/presenter/markdown.rb
Instance Attribute Summary
Attributes inherited from Base
#empty_message, #header, #rows
Instance Method Summary collapse
-
#formatted_row_separator ⇒ Object
interface method.
- #text ⇒ Object
Methods inherited from Space
Methods inherited from Base
Constructor Details
This class inherits a constructor from CliFormat::Presenter::Base
Instance Method Details
#formatted_row_separator ⇒ Object
interface method
16 17 18 |
# File 'lib/cli_format/presenter/markdown.rb', line 16 def formatted_row_separator " | " end |
#text ⇒ Object
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 |