Sha256: 0f4d76c109c2a4d01e40d1cba8713455d14ea8d4eddf3e693fd1dc805404b905

Contents?: true

Size: 457 Bytes

Versions: 3

Compression:

Stored size: 457 Bytes

Contents

module MPatch
  class Module

    # return the module objects direct sub modules
    def modules
      constants.collect {|const_name| const_get(const_name)}.select {|const| const.class == ::Module}
    end

    # return the module objects direct sub modules
    def classes
      constants.collect {|const_name| const_get(const_name)}.select {|const| const.class == ::Class}
    end

    alias :submodules :modules
    alias :subclasses :classes

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mpatch-2.1.0 lib/mpatch/module.rb
mpatch-2.0.1 lib/mpatch/module.rb
mpatch-2.0.0 lib/mpatch/module.rb