Methods

Class/Module Index [+]

Quicksearch

Sequel::SQL::NoBooleanInputMethods

This module augments the default initalize method for the ComplexExpression subclass it is included in, so that attempting to use boolean input when initializing a NumericExpression or StringExpression results in an error.

Public Class Methods

new(op, *args) click to toggle source

Raise an Error if one of the args would be boolean in an SQL context, otherwise call super.

# File lib/sequel/sql.rb, line 332
def initialize(op, *args)
  args.each do |a|
    case a
    when BooleanExpression, TrueClass, FalseClass, NilClass, Hash, Array
      raise(Error, "cannot apply #{op} to a boolean expression")
    end
  end
  super
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.