Class: Arel::Nodes::Fragments
- Inherits:
-
Node
show all
- Defined in:
- activerecord/lib/arel/nodes/fragments.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Node
#and, #equality?, #fetch_attribute, #invert, #not, #or, #to_sql
#cast, #coalesce, #create_and, #create_false, #create_join, #create_on, #create_string_join, #create_table_alias, #create_true, #grouping, #lower
Constructor Details
#initialize(values = []) ⇒ Fragments
8
9
10
11
|
# File 'activerecord/lib/arel/nodes/fragments.rb', line 8
def initialize(values = [])
super()
@values = values
end
|
Instance Attribute Details
Returns the value of attribute values.
6
7
8
|
# File 'activerecord/lib/arel/nodes/fragments.rb', line 6
def values
@values
end
|
Instance Method Details
22
23
24
25
26
|
# File 'activerecord/lib/arel/nodes/fragments.rb', line 22
def +(other)
raise ArgumentError, "Expected Arel node" unless Arel.arel_node?(other)
self.class.new([*@values, other])
end
|
#eql?(other) ⇒ Boolean
Also known as:
==
28
29
30
31
|
# File 'activerecord/lib/arel/nodes/fragments.rb', line 28
def eql?(other)
self.class == other.class &&
self.values == other.values
end
|
18
19
20
|
# File 'activerecord/lib/arel/nodes/fragments.rb', line 18
def hash
[@values].hash
end
|
#initialize_copy(other) ⇒ Object
13
14
15
16
|
# File 'activerecord/lib/arel/nodes/fragments.rb', line 13
def initialize_copy(other)
super
@values = @values.clone
end
|