Sha256: 18eabfcb435d14a243bfd32df163bb4370148dc2ff263a444bc0eab194ee00bc

Contents?: true

Size: 353 Bytes

Versions: 2

Compression:

Stored size: 353 Bytes

Contents

module Xcake
  module CoreExtensions
    # @example  Including in a class
    #           extend Xcake::CoreExtensions::ClassDescendants
    #
    module ClassDescendants
      # Returns all descendants of a class
      #
      def descendants
        ObjectSpace.each_object(singleton_class).select { |klass| klass < self }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xcake-0.11.0 lib/xcake/core_ext/class.rb
xcake-0.10.0 lib/xcake/core_ext/class.rb