Permalink
Browse files

run example scenario

  • Loading branch information...
1 parent cc5f208 commit 4b802b03fb497c79208c642fa660228c71214ac0 ruan committed Sep 17, 2010
View
Binary file not shown.
View
@@ -113,10 +113,24 @@ def transform_column(position, &block)
end
def select(&block)
- @input_data.select &block
+ result_row_list=Array.new
+ @input_data.each_with_index do |row,i|
+ result_row_list << row if block.call ArrayIndexByStr.new(row,@header)
+ end
+ @input_data=result_row_list
end
def select_column(&block)
+ length=@input_data.first.length
+ result_column_list=Array.new
+ length.times.each do |column|
+ this_column=Array.new
+ @input_data.each do |row|
+ this_column << row[column]
+ end
+ result_column_list << this_column if block.call this_column
+ end
+ @input_data=result_column_list
end
end
Oops, something went wrong.

0 comments on commit 4b802b0

Please sign in to comment.