class Activecube::Query::Selector::Operator

Attributes

argument[R]
operation[R]

Public Class Methods

new(operation, argument) click to toggle source
# File lib/activecube/query/selector.rb, line 49
def initialize operation, argument
  @operation = operation
  @argument = argument
end

Public Instance Methods

==(other) click to toggle source
# File lib/activecube/query/selector.rb, line 68
def == other
  eql? other
end
eql?(other) click to toggle source
# File lib/activecube/query/selector.rb, line 62
def eql?(other)
  return other.kind_of?(Operator) &&
      self.operation==other.operation &&
      self.argument == other.argument
end
expression(_model, left, right) click to toggle source
# File lib/activecube/query/selector.rb, line 54
def expression _model, left, right
  if right.kind_of?(Array) && (matching_array_op = ARRAY_OPERATOR_MAP[operation])
    left.send(matching_array_op, right)
  else
    left.send(operation, right)
  end
end
hash() click to toggle source
# File lib/activecube/query/selector.rb, line 72
def hash
  self.operation.hash + self.argument.hash
end