method
parse_visibility

v1_9_2_180 -
Show latest stable
-
0 notes -
Class: Ruby
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378 (0)
- 1_9_2_180 (0)
- 1_9_3_125 (38)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
parse_visibility(container, single, tk)
public
Hide source
# File lib/rdoc/parser/ruby.rb, line 1343 def parse_visibility(container, single, tk) singleton = (single == SINGLE) vis_type = tk.name 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 skip_tkspace_comment false case peek_tk # Ryan Davis suggested the extension to ignore modifiers, because he # often writes # # protected unless $TESTING # when TkNL, TkUNLESS_MOD, TkIF_MOD, TkSEMICOLON then container.ongoing_visibility = vis else if vis_type == 'module_function' then args = parse_symbol_arg container.set_visibility_for args, :private, false module_functions = [] container.methods_matching args do |m| s_m = m.dup s_m.singleton = true if RDoc::AnyMethod === s_m s_m.visibility = :public module_functions << s_m end module_functions.each do |s_m| case s_m when RDoc::AnyMethod then container.add_method s_m when RDoc::Attr then container.add_attribute s_m end end else args = parse_symbol_arg container.set_visibility_for args, vis, singleton end end end