Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

details how a corner case behaves in different Ruby versions

  • Loading branch information...
commit 76e4e686f99025a7fde612bd83080f9753159ae5 1 parent d768f74
@fxn fxn authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 activesupport/lib/active_support/core_ext/string/access.rb
View
4 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 @@ def at(position)
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.