Bug #9387

Documentation for Range#size is incomplete

Added by Florian Gilcher over 1 year ago. Updated about 1 year ago.

[ruby-core:59664]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:2.1.0 Backport:1.9.3: DONTNEED, 2.0.0: DONE, 2.1: DONE

Description

The documentation for Range#size does not mention the case where not all arguments are instances of Numeric, in which case it returns nil.

I created a patch here: https://github.com/ruby/ruby/pull/501

Associated revisions

Revision 44549
Added by Benoit Daloze over 1 year ago

  • range.c (Range#size): [DOC] improve description and add examples. Patch by @skade. [Fixes GH-501]

History

#1 Updated by Hiroshi SHIBATA over 1 year ago

  • Status changed from Open to Closed

fixed by r44549

#2 Updated by Usaku NAKAMURA over 1 year ago

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN to 1.9.3: DONTNEED, 2.0.0: REQUIRED, 2.1: REQUIRED

#3 Updated by Tomoyuki Chikanaga over 1 year ago

  • Backport changed from 1.9.3: DONTNEED, 2.0.0: REQUIRED, 2.1: REQUIRED to 1.9.3: DONTNEED, 2.0.0: DONE, 2.1: REQUIRED

r44549 was backported to ruby_2_0_0 at r45013.

#4 Updated by Yui NARUSE about 1 year ago

  • Backport changed from 1.9.3: DONTNEED, 2.0.0: DONE, 2.1: REQUIRED to 1.9.3: DONTNEED, 2.0.0: DONE, 2.1: DONE

r45118

Also available in: Atom PDF