Class: Ronin::Code::SQL::Drop
- Defined in:
- lib/ronin/code/sql/drop.rb
Instance Attribute Summary
Attributes inherited from Statement
Instance Method Summary collapse
- #emit ⇒ Object
- #if_exists ⇒ Object
-
#initialize(dialect, type, name = nil, options = {}, &block) ⇒ Drop
constructor
A new instance of Drop.
Methods inherited from Statement
clause_order, clauses, #get_clause, #has_clause?, has_clause?
Methods inherited from Expr
Constructor Details
#initialize(dialect, type, name = nil, options = {}, &block) ⇒ Drop
Returns a new instance of Drop.
29 30 31 32 33 34 35 |
# File 'lib/ronin/code/sql/drop.rb', line 29 def initialize(dialect,type,name=nil,={},&block) @type = type @name = name @if_exists = [:if_exists] super(dialect,&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
#emit ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/ronin/code/sql/drop.rb', line 42 def emit tokens = emit_token('DROP') tokens += emit_token(@type) tokens += emit_token('IF EXISTS') if @if_exists tokens += emit_value(@name) return tokens end |
#if_exists ⇒ Object
37 38 39 40 |
# File 'lib/ronin/code/sql/drop.rb', line 37 def if_exists @if_exists = true return self end |