Flowdock
method

do_methods

Importance_0
v1_9_1_378 - Show latest stable - 0 notes - Class: C
do_methods() public

No documentation

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

Hide source
# File lib/rdoc/parser/c.rb, line 197
  def do_methods
    @content.scan(%{rb_define_
                   (
                      singleton_method |
                      method           |
                      module_function  |
                      private_method
                   )
                   \s*\(\s*([\w\.]+),
                     \s*"([^"]+)",
                     \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
                     \s*(-?\w+)\s*\)
                   (?:;\s*/[*/]\s+in\s+(\w+?\.[cy]))?
                 }m) do
      |type, var_name, meth_name, meth_body, param_count, source_file|

      # Ignore top-object and weird struct.c dynamic stuff
      next if var_name == "ruby_top_self"
      next if var_name == "nstr"
      next if var_name == "envtbl"
      next if var_name == "argf"   # it'd be nice to handle this one

      var_name = "rb_cObject" if var_name == "rb_mKernel"
      handle_method(type, var_name, meth_name,
                    meth_body, param_count, source_file)
    end

    @content.scan(%{rb_define_attr\(
                             \s*([\w\.]+),
                             \s*"([^"]+)",
                             \s*(\d+),
                             \s*(\d+)\s*\);
                }m) do |var_name, attr_name, attr_reader, attr_writer|
      #var_name = "rb_cObject" if var_name == "rb_mKernel"
      handle_attr(var_name, attr_name,
                  attr_reader.to_i != 0,
                  attr_writer.to_i != 0)
    end

    @content.scan(%{rb_define_global_function\s*\(
                             \s*"([^"]+)",
                             \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
                             \s*(-?\w+)\s*\)
                (?:;\s*/[*/]\s+in\s+(\w+?\.[cy]))?
                }m) do |meth_name, meth_body, param_count, source_file|
      handle_method("method", "rb_mKernel", meth_name,
                    meth_body, param_count, source_file)
    end

    @content.scan(/define_filetest_function\s*\(
                             \s*"([^"]+)",
                             \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
                             \s*(-?\w+)\s*\)/m) do
      |meth_name, meth_body, param_count|

      handle_method("method", "rb_mFileTest", meth_name, meth_body, param_count)
      handle_method("singleton_method", "rb_cFile", meth_name, meth_body, param_count)
    end
  end
Register or log in to add new notes.