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, #not, #or, #to_sql

Methods included from FactoryMethods

#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

#valueObject (readonly)

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: ==

Returns:

  • (Boolean)


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

#hashObject



13
14
15
# File 'activerecord/lib/arel/nodes/bind_param.rb', line 13

def hash
  [self.class, self.value].hash
end

#infinite?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'activerecord/lib/arel/nodes/bind_param.rb', line 27

def infinite?
  value.respond_to?(:infinite?) && value.infinite?
end

#nil?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'activerecord/lib/arel/nodes/bind_param.rb', line 23

def nil?
  value.nil?
end

#unboundable?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'activerecord/lib/arel/nodes/bind_param.rb', line 31

def unboundable?
  value.respond_to?(:unboundable?) && value.unboundable?
end