Sha256: 966dd705bc9d9b30ccdb70ce3a3863f75a1b7d2cb69d26bcf8747022216f9adc

Contents?: true

Size: 373 Bytes

Versions: 9

Compression:

Stored size: 373 Bytes

Contents

module ObjectSpace
  class << self
    # Returns all the classes in the object space.
    def classes
      klasses = []
      ObjectSpace.each_object(Class)  { |o| klasses << o }
      klasses
    end

    def modules
      modules = []
      ObjectSpace.each_object(Module)  { |o| modules << o }
      modules
    end
  end
end unless ObjectSpace.respond_to?(:classes)

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta10 lib/spontaneous/extensions/object_space.rb
spontaneous-0.2.0.beta9 lib/spontaneous/extensions/object_space.rb
spontaneous-0.2.0.beta8 lib/spontaneous/extensions/object_space.rb
spontaneous-0.2.0.beta7 lib/spontaneous/extensions/object_space.rb
spontaneous-0.2.0.beta6 lib/spontaneous/extensions/object_space.rb
spontaneous-0.2.0.beta5 lib/spontaneous/extensions/object_space.rb
spontaneous-0.2.0.beta4 lib/spontaneous/extensions/object_space.rb
spontaneous-0.2.0.beta3 lib/spontaneous/extensions/object_space.rb
spontaneous-0.2.0.beta2 lib/spontaneous/extensions/object_space.rb