Class: Hirb::Helpers::TextTable

Inherits:
Table
  • Object
show all
Defined in:
lib/overwatch/cli/helpers.rb

Constant Summary collapse

CHARS =
{
  :top => {
    :left => '', :center => '', :right => '', :horizontal => '', :vertical => {
      :outside => '', :inside => ''
    } 
  },
  :middle => {
    :left => '', :center => '', :right => '', :horizontal => ''
  },
  :bottom => {
    :left => '', :center => '', :right => '', :horizontal => '', :vertical => {
      :outside => '', :inside => ''
    } 
  }
}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.render(rows, options = {}) ⇒ Object



82
83
84
85
# File 'lib/overwatch/cli/helpers.rb', line 82

def self.render(rows, options={})
  options.merge!(:headers => false, :description => false)
  new(rows, options).render
end

Instance Method Details

#renderObject



87
88
89
90
91
92
93
94
# File 'lib/overwatch/cli/helpers.rb', line 87

def render
  body = []
  unless @rows.length == 0
    setup_field_lengths
    body += render_rows
  end
  body.join("\n")
end