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.



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

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.



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

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.



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

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.



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

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.



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

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.



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

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:



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

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:



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

def raise?
  bang == true
end