Class: MongoMapper::Support::Find::DynamicFinder Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mongo_mapper/support/find.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method) ⇒ DynamicFinder

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of DynamicFinder.



30
31
32
33
34
35
# File 'lib/mongo_mapper/support/find.rb', line 30

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

Instance Attribute Details

#attributesObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
# File 'lib/mongo_mapper/support/find.rb', line 28

def attributes
  @attributes
end

#bangObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
# File 'lib/mongo_mapper/support/find.rb', line 28

def bang
  @bang
end

#finderObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
# File 'lib/mongo_mapper/support/find.rb', line 28

def finder
  @finder
end

#instantiatorObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
# File 'lib/mongo_mapper/support/find.rb', line 28

def instantiator
  @instantiator
end

#methodObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
# File 'lib/mongo_mapper/support/find.rb', line 28

def method
  @method
end

Instance Method Details

#found?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:



37
38
39
# File 'lib/mongo_mapper/support/find.rb', line 37

def found?
  @finder.present?
end

#raise?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:



41
42
43
# File 'lib/mongo_mapper/support/find.rb', line 41

def raise?
  bang == true
end