Class Sequel::SQL::Constant
In: lib/sequel/extensions/eval_inspect.rb
lib/sequel/sql.rb
Parent: Object

Represents constants or psuedo-constants (e.g. CURRENT_DATE) in SQL.

Methods

inspect   new  

Constants

INSPECT_LOOKUPS = [:CURRENT_DATE, :CURRENT_TIMESTAMP, :CURRENT_TIME, :SQLTRUE, :SQLFALSE, :NULL, :NOTNULL]   Constants to lookup in the Sequel module.

Attributes

constant  [R]  The underlying constant related to this object.

Public Class methods

Create a constant with the given value

[Source]

      # File lib/sequel/sql.rb, line 1231
1231:       def initialize(constant)
1232:         @constant = constant
1233:         freeze
1234:       end

Public Instance methods

Reference the constant in the Sequel module if there is one that matches.

[Source]

     # File lib/sequel/extensions/eval_inspect.rb, line 108
108:       def inspect
109:         INSPECT_LOOKUPS.each do |c|
110:           return "Sequel::#{c}" if Sequel.const_get(c) == self
111:         end
112:         super
113:       end

[Validate]