class Ronin::SQL::Statement

Represents a SQL Statement.

@api semipublic

Public Class Methods

new(keyword,argument=nil,&block) click to toggle source

Initializes a new SQL statement.

@param [Symbol, Array<Symbol>] keyword

Name of the statement.

@param [Object] argument

Additional argument for the statement.

@yield [(statement)]

If a block is given, it will be called.

@yieldparam [Statement] statement

If the block accepts an argument, it will be passed the new statement.
Otherwise the block will be evaluated within the statement.
Calls superclass method
# File lib/ronin/sql/statement.rb, line 59
def initialize(keyword,argument=nil,&block)
  super(keyword,argument)

  if block
    case block.arity
    when 0 then instance_eval(&block)
    else        block.call(self)
    end
  end
end