From 914efd0b60acc061b161faa4ebb8bce528793384 Mon Sep 17 00:00:00 2001 From: marcandre Date: Mon, 17 May 2010 21:07:46 +0000 Subject: * proc.c (proc_lambda, unnamed_parameters): Small documentation fixes. * re.c: ditto * string.c: ditto * time.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- proc.c | 9 ++++++--- re.c | 4 ++-- string.c | 2 +- time.c | 10 ++-------- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/proc.c b/proc.c index 9babd5da4b..856c3ee9bb 100644 --- a/proc.c +++ b/proc.c @@ -528,10 +528,10 @@ proc_lambda(void) /* * call-seq: - * prc === obj -> obj + * prc === obj -> result_of_proc * * Invokes the block, with obj as the block's parameter. It is - * to allow a proc object to be a target of when clause in the case statement. + * to allow a proc object to be a target of +when+ clause in the case statement. */ static VALUE @@ -728,7 +728,10 @@ unnamed_parameters(int arity) * call-seq: * proc.parameters -> array * - * returns the parameter information of this proc + * returns the parameter information of this proc. + * + * prc = lambda{|x, y=42, *rest|} + * prc.parameters #=> [[:req, :x], [:opt, :y], [:rest, :rest]] */ static VALUE diff --git a/re.c b/re.c index fc3026c4f3..dddd941515 100644 --- a/re.c +++ b/re.c @@ -2836,9 +2836,9 @@ rb_reg_match_m(int argc, VALUE *argv, VALUE re) /* * call-seq: - * Regexp.new(string [, options] [, lang]) -> regexp + * Regexp.new(string, [options [, lang]]) -> regexp * Regexp.new(regexp) -> regexp - * Regexp.compile(string [, options] [, lang]) -> regexp + * Regexp.compile(string, [options [, lang]]) -> regexp * Regexp.compile(regexp) -> regexp * * Constructs a new regular expression from pattern, which can be either diff --git a/string.c b/string.c index 22b914d234..385890ef13 100644 --- a/string.c +++ b/string.c @@ -1399,7 +1399,7 @@ rb_check_string_type(VALUE str) * Returns converted string or nil if obj cannot be converted * for any reason. * - * String.try_convert("str") #=> str + * String.try_convert("str") #=> "str" * String.try_convert(/re/) #=> nil */ static VALUE diff --git a/time.c b/time.c index 5896af8a2b..7a1fb48dfc 100644 --- a/time.c +++ b/time.c @@ -2117,13 +2117,7 @@ time_init_1(int argc, VALUE *argv, VALUE time) /* * call-seq: * Time.new -> time - * Time.new(year) -> time - * Time.new(year, month) -> time - * Time.new(year, month, day) -> time - * Time.new(year, month, day, hour) -> time - * Time.new(year, month, day, hour, min) -> time - * Time.new(year, month, day, hour, min, sec) -> time - * Time.new(year, month, day, hour, min, sec, utc_offset) -> time + * Time.new(year, month=nil, day=nil, hour=nil, min=nil, sec=nil, utc_offset=nil) -> time * * Returns a Time object. * @@ -3089,7 +3083,7 @@ time_to_f(VALUE time) /* * call-seq: - * time.to_r -> Rational + * time.to_r -> a_rational * * Returns the value of time as a rational number of seconds * since the Epoch. -- cgit v1.2.3