From 76e4e686f99025a7fde612bd83080f9753159ae5 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Tue, 22 Sep 2009 22:58:39 +0200 Subject: details how a corner case behaves in different Ruby versions --- activesupport/lib/active_support/core_ext/string/access.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/core_ext/string/access.rb b/activesupport/lib/active_support/core_ext/string/access.rb index 57385d86d2..bf11d16365 100644 --- a/activesupport/lib/active_support/core_ext/string/access.rb +++ b/activesupport/lib/active_support/core_ext/string/access.rb @@ -5,7 +5,7 @@ class String # Examples: # "hello".at(0) # => "h" # "hello".at(4) # => "o" - # "hello".at(10) # => nil + # "hello".at(10) # => ERROR if < 1.9, nil in 1.9 def at(position) mb_chars[position, 1].to_s end @@ -15,7 +15,7 @@ class String # Examples: # "hello".from(0) # => "hello" # "hello".from(2) # => "llo" - # "hello".from(10) # => nil + # "hello".from(10) # => "" if < 1.9, nil in 1.9 def from(position) mb_chars[position..-1].to_s end -- cgit v1.2.3