Module: MongoModel::DocumentExtensions::DynamicFinders

Included in:
MongoModel::Document
Defined in:
lib/mongomodel/document/dynamic_finders.rb

Instance Method Summary (collapse)

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(method_id, *args, &block)



12
13
14
15
16
17
18
# File 'lib/mongomodel/document/dynamic_finders.rb', line 12

def method_missing(method_id, *args, &block)
  if finder = DynamicFinder.match(scoped, method_id)
    finder.execute(*args)
  else
    super
  end
end

Instance Method Details

- (Boolean) respond_to?(method_id, include_private = false)

Returns:



4
5
6
7
8
9
10
# File 'lib/mongomodel/document/dynamic_finders.rb', line 4

def respond_to?(method_id, include_private = false)
  if DynamicFinder.match(scoped, method_id)
    true
  else
    super
  end
end