Class: Ronin::Code::SQL::AlterTable

Inherits:
Statement show all
Defined in:
lib/ronin/code/sql/alter_table.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) ⇒ AlterTable

Returns a new instance of AlterTable.



34
35
36
37
38
# File 'lib/ronin/code/sql/alter_table.rb', line 34

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



45
46
47
# File 'lib/ronin/code/sql/alter_table.rb', line 45

def emit
  emit_token('ALTER TABLE') + emit_value(@table) + super
end

#table(name = nil) ⇒ Object



40
41
42
43
# File 'lib/ronin/code/sql/alter_table.rb', line 40

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