lib/docrb/lib/docrb/ruby_parser.rb
def parse_module(node, parent)
      loc = node.loc.keyword
      comments = comments_from(loc.line - 1, type: :module)
      module_meta = module_to_meta(node)
      module_meta[:doc] = comments
      if parent.nil?
        @modules << module_meta
      else
        parent[:modules] ||= []
        parent[:modules] << module_meta
      end

      node.to_a.slice(1...).each do |n|
        parse!(n, module_meta)
      end
    end
# Parses a module definition
#
# node   - Node representing the module being defined
# parent - The node's parent container (e.g. class/module on which it is
#          being defined on)
Parses a module definition
node   - Node representing the module being defined
parent - The node's parent container
Parses a module definition node - Node representing the module being defined parent - The node ' s parent container
def parse_module(node, parent)
      loc = node.loc.keyword
      comments = comments_from(loc.line - 1, type: :module)
      module_meta = module_to_meta(node)
      module_meta[:doc] = comments
      if parent.nil?
        @modules << module_meta
      else
        parent[:modules] ||= []
        parent[:modules] << module_meta
      end
      node.to_a.slice(1...).each do |n|
        parse!(n, module_meta)
      end
    end
def parse_module ( node , parent ) loc = node . loc . keyword comments = comments_from ( loc . line - 1 , type : :module ) module_meta = module_to_meta ( node ) module_meta [ :doc ] = comments if parent . nil? @modules << module_meta else parent [ :modules ] ||= [ ] parent [ :modules ] << module_meta end node . to_a . slice ( 1 ... ) . each do | n | parse! ( n , module_meta ) end end
Parses a module definition
node   - Node representing the module being defined
parent - The node's parent container (e.g.
Parses a module definition node - Node representing the module being defined parent - The node ' s parent container ( e . g .
node
parent