aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-07-15 21:24:00 -0500
committerJoshua Peek <josh@joshpeek.com>2008-07-15 22:01:02 -0500
commitf4f6e57e8c2a446a4a600576f0caf0fb8921ba13 (patch)
treee3541a545c85cc00a5182532b4c2b6d9376c815d /activesupport/lib/active_support/core_ext
parent89eec91e670ae267cd88b2b3555bfefe527f0eaa (diff)
downloadrails-f4f6e57e8c2a446a4a600576f0caf0fb8921ba13.tar.gz
rails-f4f6e57e8c2a446a4a600576f0caf0fb8921ba13.tar.bz2
rails-f4f6e57e8c2a446a4a600576f0caf0fb8921ba13.zip
Added Object#metaclass
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r--activesupport/lib/active_support/core_ext/object.rb1
-rw-r--r--activesupport/lib/active_support/core_ext/object/metaclass.rb8
2 files changed, 9 insertions, 0 deletions
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