Class: Ronin::Code::SQL::Insert

Inherits:
Statement show all
Defined in:
lib/ronin/code/sql/insert.rb

Instance Attribute Summary

Attributes inherited from Statement

#clauses

Instance Method Summary collapse

Methods inherited from Statement

clause_order, clauses, #get_clause, #has_clause?, has_clause?

Methods inherited from Expr

#===, #in?, #not_in?

Constructor Details

#initialize(dialect, table = nil, options = {}, &block) ⇒ Insert

Returns a new instance of Insert.



36
37
38
39
40
# File 'lib/ronin/code/sql/insert.rb', line 36

def initialize(dialect,table=nil,options={},&block)
  @table = table

  super(dialect,options,&block)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ronin::Code::SQL::Statement

Instance Method Details

#emitObject



47
48
49
# File 'lib/ronin/code/sql/insert.rb', line 47

def emit
  emit_token('INSERT INTO') + emit_value(@table) + super
end

#table(name = nil) ⇒ Object



42
43
44
45
# File 'lib/ronin/code/sql/insert.rb', line 42

def table(name=nil)
  @table = name if name
  return @table
end