aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/arel/nodes/bind_param.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/arel/nodes/bind_param.rb')
-rw-r--r--activerecord/lib/arel/nodes/bind_param.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/activerecord/lib/arel/nodes/bind_param.rb b/activerecord/lib/arel/nodes/bind_param.rb
new file mode 100644
index 0000000000..53c5563d93
--- /dev/null
+++ b/activerecord/lib/arel/nodes/bind_param.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+module Arel # :nodoc: all
+ module Nodes
+ class BindParam < Node
+ attr_accessor :value
+
+ def initialize(value)
+ @value = value
+ super()
+ end
+
+ def hash
+ [self.class, self.value].hash
+ end
+
+ def eql?(other)
+ other.is_a?(BindParam) &&
+ value == other.value
+ end
+ alias :== :eql?
+
+ def nil?
+ value.nil?
+ end
+ end
+ end
+end