Module: EasySearch::ClassMethods

Defined in:
lib/easy_search/core.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object

“Search.users” translates to “User.find” dynamically



17
18
19
20
21
# File 'lib/easy_search/core.rb', line 17

def method_missing(name, *args)
  # instantiate a new instance of self with
  # the @klass set to the missing method
  self.new(name.to_sym)
end