Module: Pagy::Search

Defined in:
lib/pagy/extras/pagy_search.rb

Instance Method Summary collapse

Instance Method Details

#pagy_search(arg, options = {}, &block) ⇒ Object

returns an array used to delay the call of #search after the pagination variables are merged to the options it also pushes to the same array an eventually called method and arguments



10
11
12
13
14
# File 'lib/pagy/extras/pagy_search.rb', line 10

def pagy_search(arg, options={}, &block)
  [self, arg, options, block].tap do |args|
    args.define_singleton_method(:method_missing){|*a| args += a}
  end
end