Class: Hirb::Helpers::TextTable

Inherits:
Table
  • Object
show all
Defined in:
lib/overwatch/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



89
90
91
92
# File 'lib/overwatch/helpers.rb', line 89

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

Instance Method Details

#renderObject



94
95
96
97
98
99
100
101
# File 'lib/overwatch/helpers.rb', line 94

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