Method: Rex::Ui::Text::Table#drop_left
- Defined in:
- lib/rex/ui/text/table.rb
#drop_left ⇒ Object
Returns new sub-table with headers and rows maching column names submitted
Flips table 90 degrees left
230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/rex/ui/text/table.rb', line 230 def drop_left tbl = self.class.new( 'Columns' => Array.new(self.rows.count+1,' '), 'Header' => self.header, 'Indent' => self.indent) (self.columns.count+1).times do |ti| row = self.rows.map {|r| r[ti]}.unshift(self.columns[ti]).flatten # insert our col|row break. kind of hackish row[1] = "| #{row[1]}" unless row.all? {|e| e.nil? || e.empty?} tbl << row end return tbl end |