method

module_parents

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: Module
module_parents() public

Returns all the parents of this module according to its name, ordered from nested outwards. The receiver is not contained within the result.

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

M.module_parents    # => [Object]
M::N.module_parents # => [M, Object]
X.module_parents    # => [M, Object]
Show source
Register or log in to add new notes.