singleton methods (for options checking maybe?)
November 22nd, 2007 • Uncategorized
# Did this out of interest, only to find out that
# the same functionality already exists in ruby ;-)
# Obviously, I'm redefining extend on Object,
# but it still does the expected thing.
class Object
def extend(m)
instance_eval do
(class << self; self; end).send :include, m
end
end
end