Included Modules

Class Index [+]

Quicksearch

DataMapper::Query::Conditions::AndOperation

Public Instance Methods

matches?(record) click to toggle source

Match the record

@example with a Hash

  operation.matches?({ :id => 1 })  # => true

@example with a Resource

  operation.matches?(Blog::Article.new(:id => 1))  # => true

@param [Resource, Hash] record

  the resource to match

@return [true]

  true if the record matches, false if not

@api semipublic

     # File lib/dm-core/query/conditions/operation.rb, line 460
460:         def matches?(record)
461:           all? { |op| op.respond_to?(:matches?) ? op.matches?(record) : true }
462:         end
minimize() click to toggle source

Minimize the operation

@return [self]

  the minimized AndOperation

@return [AbstractOperation, AbstractComparison, Array]

  the minimized operation

@api semipublic

     # File lib/dm-core/query/conditions/operation.rb, line 472
472:         def minimize
473:           minimize_operands
474: 
475:           return Operation.new(:null) if any? && all? { |op| op.nil? }
476: 
477:           prune_operands
478: 
479:           one? ? first : self
480:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.