method

params_of

ruby latest stable - Class: Generators::RIGenerator

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.

params_of(method)
private

No documentation available.

# File lib/rdoc/generators/ri_generator.rb, line 191
    def params_of(method)
      if method.call_seq
        method.call_seq
      else
        params = method.params || ""
        
        p = params.gsub(/\s*\#.*/, '')
        p = p.tr("\n", " ").squeeze(" ")
        p = "(" + p + ")" unless p[0] == ?(
        
        if (block = method.block_params)
          block.gsub!(/\s*\#.*/, '')
          block = block.tr("\n", " ").squeeze(" ")
          if block[0] == ?(
            block.sub!(/^\(/, '').sub!(/\)/, '')
          end
          p << " {|#{block.strip}| ...}"
        end
        p
      end
    end