lib/mongoid/association/relatable.rb
# Returns an array of classes/modules forming the namespace hierarchy
# where symbols referenced in the provided class/module would be looked
# up by Ruby. For example, if mod is Foo::Bar, this method would return
# [Foo::Bar, Foo, Object].
Returns an array of classes/modules forming the namespace hierarchy
where symbols referenced in the provided class/module would be looked
up by Ruby. For example, if mod is Foo::Bar, this method would return
[Foo::Bar, Foo, Object].
Returns an array of classes / modules forming the namespace hierarchy where symbols referenced in the provided class / module would be looked up by Ruby . For example if mod is Foo :: Bar this method would return [ Foo :: Bar Foo Object ] .
def namespace_hierarchy(mod)
        parent = Object
        hier = [parent]
        mod.name.split('::').each do |part|
          parent = parent.const_get(part)
          hier << parent
        end
        hier.reverse
      end
def namespace_hierarchy ( mod ) parent = Object hier = [ parent ] mod . name . split ( '::' ) . each do | part | parent = parent . const_get ( part ) hier << parent end hier . reverse end
Returns an array of classes/modules forming the namespace hierarchy
where symbols referenced in the provided class/module would be looked
up by Ruby.
Returns an array of classes / modules forming the namespace hierarchy where symbols referenced in the provided class / module would be looked up by Ruby .
mod
<not_specific>