Skip to content
This repository
Browse code

removes unused method Class#subclasses

  • Loading branch information...
commit ec7c642f5fe60afc857aa64f1a9b4c2be56f9d70 1 parent c6104e6
Xavier Noria authored January 26, 2010
7  activesupport/lib/active_support/core_ext/class/removal.rb
@@ -16,13 +16,6 @@ def remove_subclasses
16 16
     Object.remove_subclasses_of(self)
17 17
   end
18 18
 
19  
-  # Returns an array with the names of the subclasses of +self+ as strings.
20  
-  #
21  
-  #   Integer.subclasses # => ["Bignum", "Fixnum"]
22  
-  def subclasses
23  
-    Object.subclasses_of(self).map { |o| o.to_s }
24  
-  end
25  
-
26 19
   # Removes the classes in +klasses+ from their parent module.
27 20
   #
28 21
   # Ordinary classes belong to some module via a constant. This method computes
10  activesupport/test/core_ext/class_test.rb
@@ -34,14 +34,4 @@ def test_removing_class_in_two_level_namespace
34 34
     Class.remove_class(Y::Z::C)
35 35
     assert_raise(NameError) { Y::Z::C.is_a?(Class) }
36 36
   end
37  
-  
38  
-  def test_retrieving_subclasses
39  
-    @parent   = eval("class D; end; D")
40  
-    @sub      = eval("class E < D; end; E")
41  
-    @subofsub = eval("class F < E; end; F")
42  
-    assert_equal 2, @parent.subclasses.size
43  
-    assert_equal [@subofsub.to_s], @sub.subclasses
44  
-    assert_equal [], @subofsub.subclasses
45  
-    assert_equal [@sub.to_s, @subofsub.to_s].sort, @parent.subclasses.sort
46  
-  end
47 37
 end

0 notes on commit ec7c642

Please sign in to comment.
Something went wrong with that request. Please try again.