sonic-pi

https://github.com/sonic-pi-net/sonic-pi

C++

Code. Music. Live.

Module#parent

Returns the module which contains this one according to its name.

  module M
    module N
    end
  end
  X = M::N

  M::N.parent # => M
  X.parent    # => M

The parent of top-level and anonymous modules is Object.

  M.parent          # => Object
  Module.new.parent # => Object

Source | Google | Stack overflow

Edit

git clone [email protected]:sonic-pi-net/sonic-pi.git

cd sonic-pi

open app/server/ruby/vendor/activesupport/lib/active_support/core_ext/module/introspection.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Module-parent-for-pr


# Commit to git

git add app/server/ruby/vendor/activesupport/lib/active_support/core_ext/module/introspection.rbgit commit -m "better docs for Module#parent"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Module-parent-for-pr

hub pull-request


# Celebrate!