lib/docrb/lib/docrb/ruby_parser.rb
def parse_attribute(node, parent, _target, name, args)
      parent[name] ||= []
      docs = nil
      if args.length == 1
        # When we have a single accessor, we may check for docs before it.
        docs = comments_from(node.loc.expression.first_line - 1, type: :attribute)
      end

      args.map(&:to_a).flatten.each do |n|
        parent[name].append({
                              docs: docs,
                              name: n,
                              writer_visibility: parent[:_visibility],
                              reader_visibility: parent[:_visibility]
                            })
      end
    end
# Parses an attribute definition
#
# node    - The node being parsed
# parent  - The parent containing the node being parsed
# _target - Unused.
# name    - Name of the attribute definer being called
# args    - List of attribute names being defined
Parses an attribute definition
node    - The node being parsed
parent  - The parent containing the node being parsed
_target - Unused.
name    - Name of the attribute definer being called
args    - List of attribute names being defined
Parses an attribute definition node - The node being parsed parent - The parent containing the node being parsed _target - Unused . name - Name of the attribute definer being called args - List of attribute names being defined
def parse_attribute(node, parent, _target, name, args)
      parent[name] ||= []
      docs = nil
      if args.length == 1
        docs = comments_from(node.loc.expression.first_line - 1, type: :attribute)
      end
      args.map(&:to_a).flatten.each do |n|
        parent[name].append({
                              docs: docs,
                              name: n,
                              writer_visibility: parent[:_visibility],
                              reader_visibility: parent[:_visibility]
                            })
      end
    end
def parse_attribute ( node , parent , _target , name , args ) parent [ name ] ||= [ ] docs = nil if args . length == 1 docs = comments_from ( node . loc . expression . first_line - 1 , type : :attribute ) end args . map ( & :to_a ) . flatten . each do | n | parent [ name ] . append ( { docs : docs , name : n , writer_visibility : parent [ :_visibility ] , reader_visibility : parent [ :_visibility ] } ) end end
Parses an attribute definition
node    - The node being parsed
parent  - The parent containing the node being parsed
_target - Unused.
Parses an attribute definition node - The node being parsed parent - The parent containing the node being parsed _target - Unused .
# When we have a single accessor, we may check for docs before it.
node
parent
_target
name
args