aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/module/inclusion.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-02-07 23:03:13 +0100
committerXavier Noria <fxn@hashref.com>2010-02-07 23:03:13 +0100
commitafd2e19be3b74effa3fdb9c4affd48f0aaede838 (patch)
tree81d15739b66571d3ec78066a8482af3437a8d6ea /activesupport/lib/active_support/core_ext/module/inclusion.rb
parentb235af702a086dd06fa9849ee47942e8ce82090d (diff)
downloadrails-afd2e19be3b74effa3fdb9c4affd48f0aaede838.tar.gz
rails-afd2e19be3b74effa3fdb9c4affd48f0aaede838.tar.bz2
rails-afd2e19be3b74effa3fdb9c4affd48f0aaede838.zip
removes Module#included_in_classes, which is no longer used
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module/inclusion.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/module/inclusion.rb30
1 files changed, 0 insertions, 30 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/inclusion.rb b/activesupport/lib/active_support/core_ext/module/inclusion.rb
deleted file mode 100644
index 4f23841645..0000000000
--- a/activesupport/lib/active_support/core_ext/module/inclusion.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-class Module
- # Returns the classes in the current ObjectSpace where this module has been
- # mixed in according to Module#included_modules.
- #
- # module M
- # end
- #
- # module N
- # include M
- # end
- #
- # class C
- # include M
- # end
- #
- # class D < C
- # end
- #
- # p M.included_in_classes # => [C, D]
- #
- def included_in_classes
- classes = []
- ObjectSpace.each_object(Class) { |k| classes << k if k.included_modules.include?(self) }
-
- classes.reverse.inject([]) do |unique_classes, klass|
- unique_classes << klass unless unique_classes.collect { |k| k.to_s }.include?(klass.to_s)
- unique_classes
- end
- end
-end \ No newline at end of file