param_seq()
public
Pretty parameter list for this method. If the method’s parameters were
given by call-seq it is preferred over the parsed values.
Show source
def param_seq
if @call_seq then
params = @call_seq.split("\n").last
params = params.sub(/[^( ]+/, '')
params = params.sub(/(\|[^|]+\|)\s*\.\.\.\s*(end|\})/, '\1 \2')
elsif @params then
params = @params.gsub(/\s*\#.*/, '')
params = params.tr("\n", " ").squeeze(" ")
params = "(#{params})" unless params[0] == ((
else
params = ''
end
if @block_params then
params.sub!(/,?\s*&\w+/, '')
block = @block_params.gsub(/\s*\#.*/, '')
block = block.tr("\n", " ").squeeze(" ")
if block[0] == ((
block.sub!(/^\(/, '').sub!(/\)/, '')
end
params << " { |#{block}| ... }"
end
params
end