Class | Object
In: | lib/sequel/extensions/blank.rb lib/sequel/extensions/sql_expr.rb
Parent: | Object

The sql_expr extension adds the sql_expr method to every object, which returns an wrapped object that works nicely with Sequel‘s DSL by calling Sequel.expr:

      1.sql_expr < :a     # 1 < a
      false.sql_expr & :a # FALSE AND a
      true.sql_expr | :a  # TRUE OR a
      ~nil.sql_expr       # NOT NULL
      "a".sql_expr + "b"  # 'a' || 'b'

To load the extension:

      Sequel.extension :sql_expr

### Methods

blank? sql_expr

### Public Instance methods

blank?()

Objects are blank if they respond true to empty?

[Source]

        # File lib/sequel/extensions/blank.rb, line 16
    16:   def blank?
    17:     respond_to?(:empty?) && empty?
    18:   end

sql_expr()

Return the object wrapper in an appropriate Sequel expression object.

[Source]

        # File lib/sequel/extensions/sql_expr.rb, line 17
    17:   def sql_expr
    18:     Sequel.expr(self)
    19:   end

[Validate]