Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (26 sloc) 0.562 kb
class Searches
def self.series_for amount
(1..4).map { |i| new i, amount }
end
def initialize complexity, amount
@complexity, @amount = complexity, amount
end
def each &block
@buffer.each &block
end
def prepare
@buffer = []
i = 0
CSV.open('data.csv').each do |args|
_, *args = args
args = args + [args.first]
query = []
(@complexity-1).times do
query << args.shift
end
query << args.shift
@buffer << query.join(' ')
break if (i+=1) == @amount
end
end
end
Jump to Line
Something went wrong with that request. Please try again.