Extracts the visibility information for the visibility token tk
and single class type identifier.
Returns the visibility type (a string), the visibility (a symbol) and
singleton if the methods following should be converted to
singleton methods.
# File lib/rdoc/parser/ruby.rb, line 197
def get_visibility_information tk, single # :nodoc:
vis_type = tk.name
singleton = single == SINGLE
vis =
case vis_type
when 'private' then :private
when 'protected' then :protected
when 'public' then :public
when 'private_class_method' then
singleton = true
:private
when 'public_class_method' then
singleton = true
:public
when 'module_function' then
singleton = true
:public
else
raise RDoc::Error, "Invalid visibility: #{tk.name}"
end
return vis_type, vis, singleton
end