Sha256: 624fadf282b3fa01ef1395264f9603fb0b9f49057324c0b87b01251d5163ace3

Contents?: true

Size: 230 Bytes

Versions: 127

Compression:

Stored size: 230 Bytes

Contents

class Class
  def subclasses
    result = []
    ObjectSpace.each_object(Class) do |k|
      next unless k < self
      next if k.respond_to?(:singleton_class?) && k.singleton_class?
      result << k
    end
    result
  end
end

Version data entries

127 entries across 127 versions & 1 rubygems

Version Path
specinfra-2.82.25 lib/specinfra/ext/class.rb
specinfra-2.82.24 lib/specinfra/ext/class.rb
specinfra-2.82.23 lib/specinfra/ext/class.rb
specinfra-2.82.22 lib/specinfra/ext/class.rb
specinfra-2.82.21 lib/specinfra/ext/class.rb
specinfra-2.82.20 lib/specinfra/ext/class.rb
specinfra-2.82.19 lib/specinfra/ext/class.rb
specinfra-2.82.18 lib/specinfra/ext/class.rb
specinfra-2.82.17 lib/specinfra/ext/class.rb
specinfra-2.82.16 lib/specinfra/ext/class.rb
specinfra-2.82.15 lib/specinfra/ext/class.rb
specinfra-2.82.14 lib/specinfra/ext/class.rb
specinfra-2.82.13 lib/specinfra/ext/class.rb
specinfra-2.82.12 lib/specinfra/ext/class.rb
specinfra-2.82.11 lib/specinfra/ext/class.rb
specinfra-2.82.10 lib/specinfra/ext/class.rb
specinfra-2.82.9 lib/specinfra/ext/class.rb
specinfra-2.82.8 lib/specinfra/ext/class.rb
specinfra-2.82.7 lib/specinfra/ext/class.rb
specinfra-2.82.6 lib/specinfra/ext/class.rb