Class: Sequel::BasicObject

Inherits:
BasicObject
Defined in:
lib/sequel/sql.rb,
lib/sequel/sql.rb

Overview

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}

Direct Known Subclasses

MigrationAlterTableReverser, MigrationDSL, MigrationReverser, Plugins::AssociationProxies::AssociationProxy, SQL::VirtualRow

Constant Summary

KEEP_METHODS =

The instance methods to not remove from the class when removing other methods.

%w"__id__ __send__ __metaclass__ instance_eval == equal? initialize method_missing"

Class Method Summary (collapse)

Class Method Details

+ (Object) const_missing(name)

Lookup missing constants in ::Object



28
29
30
# File 'lib/sequel/sql.rb', line 28

def self.const_missing(name)
  ::Object.const_get(name)
end

+ (Object) remove_methods!

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



14
15
# File 'lib/sequel/sql.rb', line 14

def self.remove_methods!
end