From 162d433014316a3bf11cc84890817892f8a0a96b Mon Sep 17 00:00:00 2001 From: jvazquez-r7 Date: Tue, 19 Nov 2013 15:46:11 -0600 Subject: [PATCH] Use snake_case for variables --- lib/rex/ui/text/table.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/rex/ui/text/table.rb b/lib/rex/ui/text/table.rb index 9fada23587..fff8ffd8a5 100644 --- a/lib/rex/ui/text/table.rb +++ b/lib/rex/ui/text/table.rb @@ -215,16 +215,16 @@ class Table # # Returns new sub-table with headers and rows maching column names submitted # - def [](*colnames) - tbl = self.class.new('Indent' => self.indent,'Header' => self.header,'Columns' => colnames) + def [](*col_names) + tbl = self.class.new('Indent' => self.indent,'Header' => self.header,'Columns' => col_names) idx = [] - colnames.each do |colname| - idx << self.columns.index(colname) + col_names.each do |col_name| + idx << self.columns.index(col_name) end - self.rows.each do |oldrow| - newrow = [] - idx.map {|i| newrow << oldrow[i]} - tbl << newrow + self.rows.each do |old_row| + new_row = [] + idx.map {|i| new_row << old_row[i]} + tbl << new_row end return tbl end