Froze rails gems
[depot.git] / vendor / rails / activesupport / lib / active_support / core_ext / object / metaclass.rb
diff --git a/vendor/rails/activesupport/lib/active_support/core_ext/object/metaclass.rb b/vendor/rails/activesupport/lib/active_support/core_ext/object/metaclass.rb
new file mode 100644 (file)
index 0000000..93fb0ad
--- /dev/null
@@ -0,0 +1,13 @@
+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