Flowdock
method

handle_method

Importance_1
Ruby latest stable (v2_5_5) - 0 notes - Class: RDoc::C_Parser

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1_8_7_330) is shown here.

handle_method(type, var_name, meth_name, meth_body, param_count, source_file = nil) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rdoc/parsers/parse_c.rb, line 579
    def handle_method(type, var_name, meth_name, 
                      meth_body, param_count, source_file = nil)
      progress(".")

      @stats.num_methods += 1
      class_name = @known_classes[var_name]

      return unless class_name

      class_obj  = find_class(var_name, class_name)
      
      if class_obj
        if meth_name == "initialize"
          meth_name = "new"
          type = "singleton_method"
        end
        meth_obj = AnyMethod.new("", meth_name)
        meth_obj.singleton =
          %w{singleton_method module_function}.include?(type) 
        
        p_count = (Integer(param_count) rescue -1)
        
        if p_count < 0
          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
          file_name = File.join(@file_dir, source_file)
          body = (@@known_bodies[source_file] ||= File.read(file_name))
        else
          body = @body
        end
        if find_body(meth_body, meth_obj, body) and meth_obj.document_self
          class_obj.add_method(meth_obj)
        end
      end
    end
Register or log in to add new notes.