Sha256: a888f9b11a05f1805a50dcbff24685b15b561ab307d691ee2c31c5904340cde3

Contents?: true

Size: 458 Bytes

Versions: 2

Compression:

Stored size: 458 Bytes

Contents

module MPatch
  module 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

2 entries across 2 versions & 1 rubygems

Version Path
mpatch-2.2.1 lib/mpatch/module.rb
mpatch-2.1.3 lib/mpatch/module.rb