method
handle_method
v1_9_2_180 -
Show latest stable
-
0 notes -
Class: C
- 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?
handle_method(type, var_name, meth_name, meth_body, param_count, source_file = nil)
public
Hide source
# File lib/rdoc/parser/c.rb, line 593 def handle_method(type, var_name, meth_name, meth_body, param_count, source_file = nil) class_name = @known_classes[var_name] return unless class_name class_obj = find_class var_name, class_name if class_obj then if meth_name == "initialize" then meth_name = "new" type = "singleton_method" end meth_obj = RDoc::AnyMethod.new '', meth_name meth_obj.singleton = ]singleton_method module_function].include? type p_count = Integer(param_count) rescue -1 if p_count < 0 then meth_obj.params = "(...)" elsif p_count == 0 meth_obj.params = "()" else meth_obj.params = "(" + (1..p_count).map{|i| "p#{i}"}.join(", ") + ")" end if source_file then file_name = File.join @file_dir, source_file if File.exist? file_name then body = (@@known_bodies[file_name] ||= File.read(file_name)) else warn "unknown source #{source_file} for #{meth_name} in #{@file_name}" end else body = @content end if find_body(class_name, meth_body, meth_obj, body) and meth_obj.document_self then class_obj.add_method meth_obj @stats.add_method meth_obj meth_obj.visibility = :private if 'private_method' == type end end end