instiki/vendor/rails/activesupport/lib/active_support/core_ext/object/metaclass.rb
Jacques Distler 7600aef48b Upgrade to Rails 2.2.0
As a side benefit, fix an (non-user-visible) bug in display_s5().
Also fixed a bug where removing orphaned pages did not expire cached summary pages.
2008-10-27 01:47:01 -05:00

14 lines
291 B
Ruby

class Object
# Get object's meta (ghost, eigenclass, singleton) class
def metaclass
class << self
self
end
end
# If class_eval is called on an object, add those methods to its metaclass
def class_eval(*args, &block)
metaclass.class_eval(*args, &block)
end
end