lib/docrb/lib/docrb/ruby_parser.rb
# Handles a visibility keyword for a specific target.
#
# parent - Parent containing the method call.
# name   - Name of the visibility keyword being applied
# target - Target object on which the visibility keyword is being invoked
#          against.
Handles a visibility keyword for a specific target.
parent - Parent containing the method call.
name   - Name of the visibility keyword being applied
target - Target object on which the visibility keyword is being invoked
against.
Handles a visibility keyword for a specific target . parent - Parent containing the method call . name - Name of the visibility keyword being applied target - Target object on which the visibility keyword is being invoked against .
def handle_visibility_keyword(parent, name, target)
      case target.try?(:type)
      when :def
        old_visibility = parent[:_visibility]
        parent[:_visibility] = name
        parse_def(target, parent)
        parent[:_visibility] = old_visibility
      when :defs
        old_visibility = parent[:_visibility]
        parent[:_visibility] = name
        parse_singleton_method(target, parent)
        parent[:_visibility] = old_visibility
      when :send
        old_visibility = parent[:_visibility]
        parent[:_visibility] = name
        parse_send(target, parent)
        parent[:_visibility] = old_visibility
      when :sym
        change_visibility(of: target.children.first, to: name, on: parent)
      else
        puts "BUG: Unexpected element on handle_visibility_keyword. Please file an issue."
        exit(1)
      end
    end
def handle_visibility_keyword ( parent , name , target ) case target . try? ( :type ) when :def old_visibility = parent [ :_visibility ] parent [ :_visibility ] = name parse_def ( target , parent ) parent [ :_visibility ] = old_visibility when :defs old_visibility = parent [ :_visibility ] parent [ :_visibility ] = name parse_singleton_method ( target , parent ) parent [ :_visibility ] = old_visibility when :send old_visibility = parent [ :_visibility ] parent [ :_visibility ] = name parse_send ( target , parent ) parent [ :_visibility ] = old_visibility when :sym change_visibility ( of : target . children . first , to : name , on : parent ) else puts "BUG: Unexpected element on handle_visibility_keyword. Please file an issue." exit ( 1 ) end end
Handles a visibility keyword for a specific target.
Handles a visibility keyword for a specific target .
# This one will be tricky... The called method can return anything, # so we will support at least the attr_* family. # Oh no.
parent
name
target