Use snake_case for variables

bug/bundler_fix
jvazquez-r7 2013-11-19 15:46:11 -06:00
parent 6a13a0eee6
commit 162d433014
1 changed files with 8 additions and 8 deletions

View File

@ -215,16 +215,16 @@ class Table
# #
# Returns new sub-table with headers and rows maching column names submitted # Returns new sub-table with headers and rows maching column names submitted
# #
def [](*colnames) def [](*col_names)
tbl = self.class.new('Indent' => self.indent,'Header' => self.header,'Columns' => colnames) tbl = self.class.new('Indent' => self.indent,'Header' => self.header,'Columns' => col_names)
idx = [] idx = []
colnames.each do |colname| col_names.each do |col_name|
idx << self.columns.index(colname) idx << self.columns.index(col_name)
end end
self.rows.each do |oldrow| self.rows.each do |old_row|
newrow = [] new_row = []
idx.map {|i| newrow << oldrow[i]} idx.map {|i| new_row << old_row[i]}
tbl << newrow tbl << new_row
end end
return tbl return tbl
end end