mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
25 lines
430 B
Ruby
25 lines
430 B
Ruby
module Arel
|
|
module Nodes
|
|
class Extract < Arel::Nodes::Unary
|
|
include Arel::AliasPredication
|
|
include Arel::Predications
|
|
|
|
attr_accessor :field
|
|
|
|
def initialize expr, field
|
|
super(expr)
|
|
@field = field
|
|
end
|
|
|
|
def hash
|
|
super ^ @field.hash
|
|
end
|
|
|
|
def eql? other
|
|
super &&
|
|
self.field == other.field
|
|
end
|
|
alias :== :eql?
|
|
end
|
|
end
|
|
end
|