class Ronin::SQL::Clause

Represents a SQL Clause.

@api semipublic

Public Class Methods

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

Initializes the SQL clause.

@param [Symbol] keyword

The name of the clause.

@param [Object] argument

Additional argument for the clause.

@yield [(clause)]

If a block is given, the return value will be used as the argument.

@yieldparam [Clause] clause

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

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