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