0
0
Fork 0

some refactor in the index searcher

This commit is contained in:
Gibheer 2011-05-30 20:20:17 +02:00
parent 90a13feab4
commit 6c685b4840
1 changed files with 5 additions and 4 deletions

View File

@ -16,10 +16,11 @@ class Polecat
# IndexSearcher.new 'index_dir'
# IndexSearcher.new(IndexReader.new 'index_dir')
def initialize *args
if args[0].class == Polecat::IndexReader
@reader = args[0]
elsif args[0].class == String
@reader = Polecat::IndexReader.new args[0]
first = args[0]
if first.class == Polecat::IndexReader
@reader = first
elsif first.class == String
@reader = Polecat::IndexReader.new first
end
end