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

- (InsertStatement) initialize



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

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

Instance Attribute Details

- (Object) columns

Returns the value of attribute columns



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

def columns
  @columns
end

- (Object) relation

Returns the value of attribute relation



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

def relation
  @relation
end

- (Object) values

Returns the value of attribute values



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

def values
  @values
end

Instance Method Details

- (Boolean) eql?(other) Also known as: ==



23
24
25
26
27
28
# File 'lib/arel/nodes/insert_statement.rb', line 23

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

- (Object) hash



19
20
21
# File 'lib/arel/nodes/insert_statement.rb', line 19

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

- (Object) initialize_copy(other)



13
14
15
16
17
# File 'lib/arel/nodes/insert_statement.rb', line 13

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