Class: DataMapper::Query::Conditions::NotOperation

Inherits:
AbstractOperation show all
Defined in:
lib/dm-core/query/conditions/operation.rb

Overview

class OrOperation

Instance Attribute Summary

Attributes inherited from AbstractOperation

#operands

Instance Method Summary collapse

Methods inherited from AbstractOperation

descendants, #each, inherited, #inspect, #slug, slug, #sorted_operands, #valid?

Methods included from Equalizer

#equalize

Instance Method Details

#<<(operand) ⇒ Object

TODO: document

Raises:

  • (ArgumentError)


182
183
184
185
# File 'lib/dm-core/query/conditions/operation.rb', line 182

def <<(operand)
  raise ArgumentError, "#{self.class} cannot have more than one operand" if @operands.size > 0
  super
end

#matches?(record) ⇒ Boolean

TODO: document

Returns:

  • (Boolean)


176
177
178
# File 'lib/dm-core/query/conditions/operation.rb', line 176

def matches?(record)
  not @operands.first.matches?(record)
end