Included Modules

Class Index [+]

Quicksearch

DataMapper::Query::Conditions::EqualToComparison

Tests whether the value in the record is equal to the expected set for the Comparison.

Public Instance Methods

matches?(record) click to toggle source

Tests that the record value matches the comparison

@param [Resource, Hash] record

  The record containing the value to be matched

@return [Boolean]

@api semipublic

     # File lib/dm-core/query/conditions/comparison.rb, line 529
529:         def matches?(record)
530:           if expected.nil?
531:             record_value(record).nil?
532:           else
533:             super
534:           end
535:         end

Private Instance Methods

comparator_string() click to toggle source

@return [String]

@see AbstractComparison#to_s

@api private

     # File lib/dm-core/query/conditions/comparison.rb, line 563
563:         def comparator_string
564:           '='
565:         end
typecast_hash(hash) click to toggle source

@api private

     # File lib/dm-core/query/conditions/comparison.rb, line 548
548:         def typecast_hash(hash)
549:           subject = self.subject
550:           subject.target_model.new(subject.query.merge(hash))
551:         end
typecast_relationship(value) click to toggle source

@api private

     # File lib/dm-core/query/conditions/comparison.rb, line 540
540:         def typecast_relationship(value)
541:           case value
542:             when Hash     then typecast_hash(value)
543:             when Resource then typecast_resource(value)
544:           end
545:         end
typecast_resource(resource) click to toggle source

@api private

     # File lib/dm-core/query/conditions/comparison.rb, line 554
554:         def typecast_resource(resource)
555:           resource
556:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.