Class: DataMapper::Query::Conditions::EqualToComparison

Inherits:
AbstractComparison show all
Includes:
RelationshipHandler
Defined in:
lib/dm-core/query/conditions/comparison.rb

Overview

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

Instance Attribute Summary

Attributes inherited from AbstractComparison

#loaded_value, #subject, #value

Instance Method Summary collapse

Methods included from RelationshipHandler

#foreign_key_mapping, #relationship?

Methods inherited from AbstractComparison

descendants, inherited, #inspect, #property?, #relationship?, #slug, slug, #to_s, #valid?

Methods included from Deprecate

#deprecate

Methods included from Equalizer

#equalize

Instance Method Details

#matches?(record) ⇒ Boolean

Asserts that the record value matches the comparison

Parameters:

  • record (Resource, Hash)

    The record containing the value to be matched

Returns:

  • (Boolean)


479
480
481
# File 'lib/dm-core/query/conditions/comparison.rb', line 479

def matches?(record)
  record_value(record) == expected
end