Sha256: 291ed9d7f797589dcb0544161566631a2632bba0ab02a5a249ddd9fa32a81e4b

Contents?: true

Size: 344 Bytes

Versions: 8

Compression:

Stored size: 344 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

8 entries across 8 versions & 1 rubygems

Version Path
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb
jstorimer-deep-test-1.2.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb
jstorimer-deep-test-1.1.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb
jstorimer-deep-test-1.0.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb
jstorimer-deep-test-0.2.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb
jstorimer-deep-test-0.1.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb