to_formatted_s is an instance method for a Range not an Array

This commit is contained in:
Ayrton De Craene 2011-10-04 15:21:23 +03:00
parent 96aa3bd0ea
commit 02b0f8d9ff
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@ class Range
#
# ==== Example
#
# [1..100].to_formatted_s # => "1..100"
# (1..100).to_formatted_s # => "1..100"
def to_formatted_s(format = :default)
if formatter = RANGE_FORMATS[format]
formatter.call(first, last)