Module: Sequel::SQL::NoBooleanInputMethods
- Included in:
- NumericExpression, StringExpression
- Defined in:
- lib/sequel/sql.rb
Overview
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. It is not expected to be used directly.
Instance Method Summary collapse
-
#initialize(op, *args) ⇒ Object
Raise an
Error
if one of the args would be boolean in an SQL context, otherwise call super.
Instance Method Details
#initialize(op, *args) ⇒ Object
Raise an Error
if one of the args would be boolean in an SQL context, otherwise call super.
389 390 391 392 393 394 395 396 397 |
# File 'lib/sequel/sql.rb', line 389 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 |