lib/docrb/lib/docrb/ruby_parser.rb
# Parses a class method definition
#
# node   - Node representing the method being defined
# parent - The node's parent container (e.g. class on which it is being
#          defined on)
Parses a class method definition
node   - Node representing the method being defined
parent - The node's parent container
Parses a class method definition node - Node representing the method being defined parent - The node ' s parent container
def parse_singleton_method(node, parent)
      loc = node.loc.keyword
      comments = comments_from(loc.line - 1, type: :defs)
      def_meta = singleton_method_to_meta(node)
      def_meta[:doc] = comments
      def_meta[:visibility] = parent ? parent[:_visibility] : :public
      if parent.nil?
        @methods << def_meta
      else
        parent[:methods] ||= []
        parent[:methods] << def_meta
      end
    end
def parse_singleton_method ( node , parent ) loc = node . loc . keyword comments = comments_from ( loc . line - 1 , type : :defs ) def_meta = singleton_method_to_meta ( node ) def_meta [ :doc ] = comments def_meta [ :visibility ] = parent ? parent [ :_visibility ] : :public if parent . nil? @methods << def_meta else parent [ :methods ] ||= [ ] parent [ :methods ] << def_meta end end
Parses a class method definition
node   - Node representing the method being defined
parent - The node's parent container (e.g.
Parses a class method definition node - Node representing the method being defined parent - The node ' s parent container ( e . g .
node
parent