Class: Arel::Nodes::BindParam

Inherits:
Node
  • Object
show all
Defined in:
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

Methods included from FactoryMethods

#cast, #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 '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 '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 'lib/arel/nodes/bind_param.rb', line 17

def eql?(other)
  other.is_a?(BindParam) &&
    value == other.value
end

#hashObject



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

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

#infinite?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/arel/nodes/bind_param.rb', line 35

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

#nil?Boolean

Returns:

  • (Boolean)


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

def nil?
  value.nil?
end

#unboundable?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/arel/nodes/bind_param.rb', line 39

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

#value_before_type_castObject



27
28
29
30
31
32
33
# File '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