mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use friendlier method name
This commit is contained in:
parent
db6eb1930d
commit
16bee7618c
2 changed files with 3 additions and 3 deletions
|
@ -168,8 +168,8 @@ module ActiveSupport #:nodoc:
|
|||
#
|
||||
# Example:
|
||||
# 'क्षि'.mb_chars.length # => 4
|
||||
# 'क्षि'.mb_chars.g_length # => 3
|
||||
def g_length
|
||||
# 'क्षि'.mb_chars.grapheme_length # => 3
|
||||
def grapheme_length
|
||||
Unicode.unpack_graphemes(@wrapped_string).length
|
||||
end
|
||||
|
||||
|
|
|
@ -595,7 +595,7 @@ class MultibyteCharsExtrasTest < Test::Unit::TestCase
|
|||
else
|
||||
str = input
|
||||
end
|
||||
assert_equal expected_length, chars(str).g_length
|
||||
assert_equal expected_length, chars(str).grapheme_length
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue