Class Sequel::BasicObject
In: lib/sequel/sql.rb
Parent: Object

If on 1.9, create a Sequel::BasicObject class that is just like the default BasicObject class, except that missing constants are resolved in Object. This allows the virtual row support to work with classes without prefixing them with ::, such as:

  DB[:bonds].filter{maturity_date > Time.now}

Methods

Constants

KEEP_METHODS = %w"__id__ __send__ __metaclass__ instance_eval instance_exec == equal? initialize method_missing"   The instance methods to not remove from the class when removing other methods.

Public Class methods

Lookup missing constants in ::Object

[Source]

    # File lib/sequel/sql.rb, line 32
32:       def self.const_missing(name)
33:         ::Object.const_get(name)
34:       end

Remove all but the most basic instance methods from the class. A separate method so that it can be called again if necessary if you load libraries after Sequel that add instance methods to Object.

[Source]

    # File lib/sequel/sql.rb, line 17
17:       def self.remove_methods!
18:         ((private_instance_methods + instance_methods) - KEEP_METHODS).each{|m| undef_method(m)}
19:       end

No-op method on ruby 1.9, which has a real BasicObject class.

[Source]

    # File lib/sequel/sql.rb, line 37
37:       def self.remove_methods!
38:       end

[Validate]