module Tire::DSL

Public Instance Methods

suggest(indices=nil, options={}, &block) click to toggle source
# File lib/tire-suggest_plugin.rb, line 5
def suggest(indices=nil, options={}, &block)
  if block_given?
    Tire::SuggestPlugin::Suggest.new(indices, options, &block)
  elsif options.respond_to?(:to_hash)
    Tire::SuggestPlugin::Suggest.new(indices, options.to_hash)
  else
    raise ArgumentError, "Please pass a Ruby Hash or an object with `to_hash` method, not #{options.class}"
  end
end