class Sequel::BasicObject
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}
Constants
- KEEP_METHODS
The instance methods to not remove from the class when removing other methods.
Public Class Methods
const_missing(name)
click to toggle source
Lookup missing constants in ::Object
# File lib/sequel/sql.rb, line 30 def self.const_missing(name) ::Object.const_get(name) end
remove_methods!()
click to toggle source
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
.
# File lib/sequel/sql.rb, line 15 def self.remove_methods! ((private_instance_methods + instance_methods) - KEEP_METHODS).each{|m| undef_method(m)} end