Class: Arel::Nodes::BindParam
- Inherits:
-
Node
show all
- Defined in:
- activerecord/lib/arel/nodes/bind_param.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Node
#and, #equality?, #fetch_attribute, #invert, #not, #or, #to_sql
#coalesce, #create_and, #create_false, #create_join, #create_on, #create_string_join, #create_table_alias, #create_true, #grouping, #lower
Constructor Details
#initialize(value) ⇒ BindParam
Returns a new instance of BindParam.
8
9
10
11
|
# File 'activerecord/lib/arel/nodes/bind_param.rb', line 8
def initialize(value)
@value = value
super()
end
|
Instance Attribute Details
Returns the value of attribute value
6
7
8
|
# File 'activerecord/lib/arel/nodes/bind_param.rb', line 6
def value
@value
end
|
Instance Method Details
#eql?(other) ⇒ Boolean
Also known as:
==
17
18
19
20
|
# File 'activerecord/lib/arel/nodes/bind_param.rb', line 17
def eql?(other)
other.is_a?(BindParam) &&
value == other.value
end
|
13
14
15
|
# File 'activerecord/lib/arel/nodes/bind_param.rb', line 13
def hash
[self.class, self.value].hash
end
|
#infinite? ⇒ Boolean
35
36
37
|
# File 'activerecord/lib/arel/nodes/bind_param.rb', line 35
def infinite?
value.respond_to?(:infinite?) && value.infinite?
end
|
#nil? ⇒ Boolean
23
24
25
|
# File 'activerecord/lib/arel/nodes/bind_param.rb', line 23
def nil?
value.nil?
end
|
#unboundable? ⇒ Boolean
39
40
41
|
# File 'activerecord/lib/arel/nodes/bind_param.rb', line 39
def unboundable?
value.respond_to?(:unboundable?) && value.unboundable?
end
|
#value_before_type_cast ⇒ Object
27
28
29
30
31
32
33
|
# File 'activerecord/lib/arel/nodes/bind_param.rb', line 27
def value_before_type_cast
if value.respond_to?(:value_before_type_cast)
value.value_before_type_cast
else
value
end
end
|