Class: Squeel::Nodes::Unary

Inherits:
Object
  • Object
show all
Includes:
PredicateOperators
Defined in:
lib/squeel/nodes/unary.rb

Direct Known Subclasses

Not

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PredicateOperators

#&, #-@, #|

Constructor Details

#initialize(expr) ⇒ Unary

Returns a new instance of Unary.



10
11
12
# File 'lib/squeel/nodes/unary.rb', line 10

def initialize(expr)
  @expr = expr
end

Instance Attribute Details

#exprObject (readonly)

Returns the value of attribute expr.



8
9
10
# File 'lib/squeel/nodes/unary.rb', line 8

def expr
  @expr
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


14
15
16
17
# File 'lib/squeel/nodes/unary.rb', line 14

def eql?(other)
  self.class == other.class &&
  self.expr  == other.expr
end