diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-09 21:23:45 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-09 21:23:45 +0000 |
commit | d31cd06516c01a6a2003bca7750da05d86bca7c8 (patch) | |
tree | cca0416df04aa4c19554ce74202d728725abbd7d /range.c | |
parent | e5839862e4ad6ac171319629f5a593789f8380c4 (diff) |
* range.c (Range#size): [DOC] improve description and add examples.
Patch by @skade. [Fixes GH-501]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'range.c')
-rw-r--r-- | range.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -711,9 +711,12 @@ sym_each_i(RB_BLOCK_CALL_FUNC_ARGLIST(v, arg)) * call-seq: * rng.size -> num * - * Returns the number of elements in the range. + * Returns the number of elements in the range. Both the begin and the end of + * the Range must be Numeric, otherwise nil is returned. * * (10..20).size #=> 11 + * ('a'..'z').size #=> nil + * (-Float::INFINITY..Float::INFINITY).size #=> Infinity */ static VALUE |