Created
February 3, 2010 20:17
-
-
Save burke/293983 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From e8391aaebdca619551ab0b1bd5e1b19091728c80 Mon Sep 17 00:00:00 2001 | |
| From: Burke Libbey <[email protected]> | |
| Date: Wed, 3 Feb 2010 12:53:57 -0600 | |
| Subject: [PATCH] FIXED #methods to return class methods on the class of an instance of a metaclass | |
| --- | |
| kernel/common/kernel.rb | 3 +++ | |
| 1 files changed, 3 insertions(+), 0 deletions(-) | |
| diff --git a/kernel/common/kernel.rb b/kernel/common/kernel.rb | |
| index 3296ae0..edb8586 100644 | |
| --- a/kernel/common/kernel.rb | |
| +++ b/kernel/common/kernel.rb | |
| @@ -542,6 +542,9 @@ module Kernel | |
| def methods(all=true) | |
| methods = singleton_methods(all) | |
| methods |= self.class.instance_methods(true) if all | |
| + if self.respond_to?(:__metaclass_object__) | |
| + methods |= self.__metaclass_object__.class.singleton_methods | |
| + end | |
| return methods if kind_of?(ImmediateValue) | |
| -- | |
| 1.6.6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment