Sha256: 0d418a1865d0cd5f29933ff974202628216a281df7078bba6154435ab4e24992

Contents?: true

Size: 343 Bytes

Versions: 92

Compression:

Stored size: 343 Bytes

Contents

class Module
  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

Version data entries

92 entries across 92 versions & 7 rubygems

Version Path
activesupport-1.4.3 lib/active_support/core_ext/module/inclusion.rb
activesupport-1.3.1 lib/active_support/core_ext/module/inclusion.rb
activesupport-1.4.4 lib/active_support/core_ext/module/inclusion.rb
activesupport-2.0.0 lib/active_support/core_ext/module/inclusion.rb
activesupport-2.0.1 lib/active_support/core_ext/module/inclusion.rb
activesupport-1.4.0 lib/active_support/core_ext/module/inclusion.rb
activesupport-1.4.1 lib/active_support/core_ext/module/inclusion.rb
activesupport-1.3.0 lib/active_support/core_ext/module/inclusion.rb
activesupport-1.4.2 lib/active_support/core_ext/module/inclusion.rb
activesupport-2.0.2 lib/active_support/core_ext/module/inclusion.rb
activesupport-2.0.5 lib/active_support/core_ext/module/inclusion.rb
activesupport-2.0.4 lib/active_support/core_ext/module/inclusion.rb
backlog-0.0.0 vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb
backlog-0.0.1 vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb
backlog-0.0.2 vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb
backlog-0.0.4 vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb
backlog-0.0.5 vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb
backlog-0.1.1 vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb
backlog-0.1.0 vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb
backlog-0.1.2 vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb