Class: Arel::Nodes::Fragments
- Defined in:
- activerecord/lib/arel/nodes/fragments.rb
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
- #+(other) ⇒ Object
- #eql?(other) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(values = []) ⇒ Fragments
constructor
A new instance of Fragments.
- #initialize_copy(other) ⇒ Object
Methods inherited from Node
#and, #equality?, #fetch_attribute, #invert, #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(values = []) ⇒ Fragments
Returns a new instance of Fragments.
8 9 10 11 |
# File 'activerecord/lib/arel/nodes/fragments.rb', line 8 def initialize(values = []) super() @values = values end |
Instance Attribute Details
#values ⇒ Object (readonly)
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
#+(other) ⇒ Object
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 |
#hash ⇒ Object
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 |