diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/object/extending.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/extending.rb | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/extending.rb b/activesupport/lib/active_support/core_ext/object/extending.rb index 5a375f39ad..76ed8801f9 100644 --- a/activesupport/lib/active_support/core_ext/object/extending.rb +++ b/activesupport/lib/active_support/core_ext/object/extending.rb @@ -1,40 +1,6 @@ require 'active_support/core_ext/class/removal' require 'active_support/core_ext/object/blank' -class Class - # Rubinius - if defined?(Class.__subclasses__) - def descendents - subclasses = [] - __subclasses__.each {|k| subclasses << k; subclasses.concat k.descendents } - subclasses - end - else - # MRI - begin - ObjectSpace.each_object(Class.new) {} - - def descendents - subclasses = [] - ObjectSpace.each_object(class << self; self; end) do |k| - subclasses << k unless k == self - end - subclasses - end - # JRuby - rescue StandardError - def descendents - subclasses = [] - ObjectSpace.each_object(Class) do |k| - subclasses << k if k < self - end - subclasses.uniq! - subclasses - end - end - end -end - class Object def extended_by #:nodoc: ancestors = class << self; ancestors end |