2017-02-13 13:58:58 -05:00
|
|
|
# frozen_string_literal: true
|
2018-02-24 01:45:50 -05:00
|
|
|
|
2018-02-24 02:41:47 -05:00
|
|
|
module Arel # :nodoc: all
|
2014-11-17 17:52:38 -05:00
|
|
|
module Nodes
|
|
|
|
class BindParam < Node
|
2017-07-24 08:04:56 -04:00
|
|
|
attr_accessor :value
|
2017-07-21 08:33:09 -04:00
|
|
|
|
|
|
|
def initialize(value)
|
|
|
|
@value = value
|
|
|
|
super()
|
|
|
|
end
|
|
|
|
|
2017-07-25 09:12:11 -04:00
|
|
|
def hash
|
|
|
|
[self.class, self.value].hash
|
|
|
|
end
|
|
|
|
|
|
|
|
def eql?(other)
|
2017-07-21 08:33:09 -04:00
|
|
|
other.is_a?(BindParam) &&
|
|
|
|
value == other.value
|
2015-01-25 16:47:47 -05:00
|
|
|
end
|
2017-07-25 09:12:11 -04:00
|
|
|
alias :== :eql?
|
2017-07-24 08:04:56 -04:00
|
|
|
|
|
|
|
def nil?
|
|
|
|
value.nil?
|
|
|
|
end
|
2014-11-17 17:52:38 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|