lib/picky/search.rb in picky-4.19.4 vs lib/picky/search.rb in picky-4.19.5
- old
+ new
@@ -59,11 +59,11 @@
# search = Search.new(index1, index2, index3) do
# searching MyTokenizerThatRespondsToTheMethodTokenize.new
# end
#
def searching options
- @tokenizer = if options.respond_to?(:tokenize)
+ @tokenizer = if options.respond_to? :tokenize
options
else
options && Tokenizer.new(options)
end
end
@@ -272,16 +272,14 @@
end
# Display some nice information for the user.
#
def to_s
- s = "#{self.class}("
- ary = []
- ary << @indexes.indexes.map(&:name).join(', ') unless @indexes.indexes.empty?
- ary << "boosts: #@boosts" if @boosts
- s << ary.join(', ')
- s << ")"
- s
+ s = [
+ (@indexes.indexes.map(&:name).join(', ') unless @indexes.indexes.empty?),
+ ("boosts: #@boosts" if @boosts)
+ ].compact
+ "#{self.class}(#{s.join(', ')})"
end
end
end
\ No newline at end of file