Class: Arel::Nodes::InsertStatement

Inherits:
Node
  • Object
show all
Defined in:
lib/arel/nodes/insert_statement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#_caller, #and, #each, #not, #or, #to_sql

Methods included from FactoryMethods

#create_and, #create_false, #create_join, #create_on, #create_string_join, #create_table_alias, #create_true, #grouping, #lower

Constructor Details

#initializeInsertStatement

Returns a new instance of InsertStatement.



7
8
9
10
11
12
13
# File 'lib/arel/nodes/insert_statement.rb', line 7

def initialize
  super()
  @relation = nil
  @columns  = []
  @values   = nil
  @select   = nil
end

Instance Attribute Details

#columnsObject

Returns the value of attribute columns.



5
6
7
# File 'lib/arel/nodes/insert_statement.rb', line 5

def columns
  @columns
end

#relationObject

Returns the value of attribute relation.



5
6
7
# File 'lib/arel/nodes/insert_statement.rb', line 5

def relation
  @relation
end

#selectObject

Returns the value of attribute select.



5
6
7
# File 'lib/arel/nodes/insert_statement.rb', line 5

def select
  @select
end

#valuesObject

Returns the value of attribute values.



5
6
7
# File 'lib/arel/nodes/insert_statement.rb', line 5

def values
  @values
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


26
27
28
29
30
31
32
# File 'lib/arel/nodes/insert_statement.rb', line 26

def eql? other
  self.class == other.class &&
    self.relation == other.relation &&
    self.columns == other.columns &&
    self.select == other.select &&
    self.values == other.values
end

#hashObject



22
23
24
# File 'lib/arel/nodes/insert_statement.rb', line 22

def hash
  [@relation, @columns, @values, @select].hash
end

#initialize_copy(other) ⇒ Object



15
16
17
18
19
20
# File 'lib/arel/nodes/insert_statement.rb', line 15

def initialize_copy other
  super
  @columns = @columns.clone
  @values =  @values.clone if @values
  @select =  @select.clone if @select
end