Class: Arel::Nodes::Unary

Inherits:
Node
  • Object
show all
Defined in:
lib/arel/nodes/unary.rb

Direct Known Subclasses

Extract, Following, Grouping, Preceding, Quoted, Range, Rows, UnqualifiedColumn, With

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Node

#_caller, #and, #each, #not, #or, #to_sql

Methods included from FactoryMethods

#create_and, #create_false, #create_join, #create_on, #create_string_join, #create_table_alias, #create_true, #grouping, #lower

Constructor Details

- (Unary) initialize(expr)



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

def initialize expr
  super()
  @expr = expr
end

Instance Attribute Details

- (Object) expr Also known as: value

Returns the value of attribute expr



4
5
6
# File 'lib/arel/nodes/unary.rb', line 4

def expr
  @expr
end

Instance Method Details

- (Boolean) eql?(other) Also known as: ==



16
17
18
19
# File 'lib/arel/nodes/unary.rb', line 16

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

- (Object) hash



12
13
14
# File 'lib/arel/nodes/unary.rb', line 12

def hash
  @expr.hash
end