123456789_123456789_123456789_123456789_123456789_

Class: Arel::Nodes::Unary

Do not use. This class is for internal use only.

Class Method Summary

Instance Attribute Summary

  • #expr (also: #value, #rows, #attribute) rw
  • #value (also: #value_for_database, #value_before_type_cast) readonly

    Alias for #expr.

Node - Inherited

Instance Method Summary

Constructor Details

.new(expr) ⇒ Unary

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/unary.rb', line 9

def initialize(expr)
  super()
  @expr = expr
end

Instance Attribute Details

#expr (rw) Also known as: #value, #rows, #attribute

[ GitHub ]

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

attr_accessor :expr

#value (readonly) Also known as: #value_for_database, #value_before_type_cast

Alias for #expr.

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/unary.rb', line 7

alias :value :expr

Instance Method Details

#==(other)

Alias for #eql?.

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/unary.rb', line 22

alias :== :eql?

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

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/unary.rb', line 18

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

#hash

[ GitHub ]

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

def hash
  @expr.hash
end