From f4f6e57e8c2a446a4a600576f0caf0fb8921ba13 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 15 Jul 2008 21:24:00 -0500 Subject: Added Object#metaclass --- activesupport/lib/active_support/core_ext/object.rb | 1 + activesupport/lib/active_support/core_ext/object/metaclass.rb | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 activesupport/lib/active_support/core_ext/object/metaclass.rb (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/object.rb b/activesupport/lib/active_support/core_ext/object.rb index bbc7d81672..0796a7b710 100644 --- a/activesupport/lib/active_support/core_ext/object.rb +++ b/activesupport/lib/active_support/core_ext/object.rb @@ -1,4 +1,5 @@ require 'active_support/core_ext/object/conversions' require 'active_support/core_ext/object/extending' require 'active_support/core_ext/object/instance_variables' +require 'active_support/core_ext/object/metaclass' require 'active_support/core_ext/object/misc' diff --git a/activesupport/lib/active_support/core_ext/object/metaclass.rb b/activesupport/lib/active_support/core_ext/object/metaclass.rb new file mode 100644 index 0000000000..169a76dfb7 --- /dev/null +++ b/activesupport/lib/active_support/core_ext/object/metaclass.rb @@ -0,0 +1,8 @@ +class Object + # Get object's meta (ghost, eigenclass, singleton) class + def metaclass + class << self + self + end + end +end -- cgit v1.2.3