Class: MongoMapper::DynamicFinder

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method) ⇒ DynamicFinder

Returns a new instance of DynamicFinder.



40
41
42
43
44
45
# File 'lib/novelys_mongo_mapper/dynamic_finder.rb', line 40

def initialize(method)
  @method = method
  @finder = :first
  @bang   = false
  match
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



38
39
40
# File 'lib/novelys_mongo_mapper/dynamic_finder.rb', line 38

def attributes
  @attributes
end

#bangObject (readonly)

Returns the value of attribute bang.



38
39
40
# File 'lib/novelys_mongo_mapper/dynamic_finder.rb', line 38

def bang
  @bang
end

#finderObject (readonly)

Returns the value of attribute finder.



38
39
40
# File 'lib/novelys_mongo_mapper/dynamic_finder.rb', line 38

def finder
  @finder
end

#instantiatorObject (readonly)

Returns the value of attribute instantiator.



38
39
40
# File 'lib/novelys_mongo_mapper/dynamic_finder.rb', line 38

def instantiator
  @instantiator
end

#methodObject (readonly)

Returns the value of attribute method.



38
39
40
# File 'lib/novelys_mongo_mapper/dynamic_finder.rb', line 38

def method
  @method
end

Instance Method Details

#found?Boolean

Returns:



47
48
49
# File 'lib/novelys_mongo_mapper/dynamic_finder.rb', line 47

def found?
  @finder.present?
end

#raise?Boolean

Returns:



51
52
53
# File 'lib/novelys_mongo_mapper/dynamic_finder.rb', line 51

def raise?
  bang == true
end