diff options
author | Xavier Noria <fxn@hashref.com> | 2009-09-22 22:58:39 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2009-09-22 23:09:30 +0200 |
commit | 76e4e686f99025a7fde612bd83080f9753159ae5 (patch) | |
tree | 43daa39c7928b4660dfd86e5df45297f6280a636 | |
parent | d768f7415eab526a746fab07e04fe664ff31f231 (diff) | |
download | rails-76e4e686f99025a7fde612bd83080f9753159ae5.tar.gz rails-76e4e686f99025a7fde612bd83080f9753159ae5.tar.bz2 rails-76e4e686f99025a7fde612bd83080f9753159ae5.zip |
details how a corner case behaves in different Ruby versions
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/access.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |