Class: MongoMapper::DynamicFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/mongomapper/dynamic_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, method) ⇒ DynamicFinder

Returns a new instance of DynamicFinder.



5
6
7
8
9
10
# File 'lib/mongomapper/dynamic_finder.rb', line 5

def initialize(model, method)
  @model = model
  @options = {}
  @options[:method] = method
  match
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/mongomapper/dynamic_finder.rb', line 3

def options
  @options
end

Instance Method Details

#valid?Boolean

Returns:



12
13
14
# File 'lib/mongomapper/dynamic_finder.rb', line 12

def valid?
  @options[:finder].present?
end