diff options
author | Jon Moss <maclover7@users.noreply.github.com> | 2017-02-16 19:32:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-16 19:32:13 -0500 |
commit | f6723ceb6a271e2b1de3e8941578b6315faa93c4 (patch) | |
tree | 830dec0ad15f37d678d2ceabcc91a518793b1589 /activesupport | |
parent | 6dccceef9c888e7e8a2cdcd46cd896eff75d64d9 (diff) | |
parent | 642880819b5fa655886fe5a944c6628e2fb7974f (diff) | |
download | rails-f6723ceb6a271e2b1de3e8941578b6315faa93c4.tar.gz rails-f6723ceb6a271e2b1de3e8941578b6315faa93c4.tar.bz2 rails-f6723ceb6a271e2b1de3e8941578b6315faa93c4.zip |
Merge pull request #28040 from kenta-s/fix-doc-in-multibyte-chars
Fix doc in Multibyte::Chars [ci skip]
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/multibyte/chars.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/multibyte/chars.rb b/activesupport/lib/active_support/multibyte/chars.rb index 65d6259a06..8c58466556 100644 --- a/activesupport/lib/active_support/multibyte/chars.rb +++ b/activesupport/lib/active_support/multibyte/chars.rb @@ -16,7 +16,8 @@ module ActiveSupport #:nodoc: # through the +mb_chars+ method. Methods which would normally return a # String object now return a Chars object so methods can be chained. # - # 'The Perfect String '.mb_chars.downcase.strip.normalize # => "the perfect string" + # 'The Perfect String '.mb_chars.downcase.strip.normalize + # # => #<ActiveSupport::Multibyte::Chars:0x007fdc434ccc10 @wrapped_string="the perfect string"> # # Chars objects are perfectly interchangeable with String objects as long as # no explicit class checks are made. If certain methods do explicitly check @@ -134,7 +135,7 @@ module ActiveSupport #:nodoc: # Converts characters in the string to the opposite case. # - # 'El Cañón".mb_chars.swapcase.to_s # => "eL cAÑÓN" + # 'El Cañón'.mb_chars.swapcase.to_s # => "eL cAÑÓN" def swapcase chars Unicode.swapcase(@wrapped_string) end @@ -148,8 +149,8 @@ module ActiveSupport #:nodoc: # Capitalizes the first letter of every word, when possible. # - # "ÉL QUE SE ENTERÓ".mb_chars.titleize # => "Él Que Se Enteró" - # "日本語".mb_chars.titleize # => "日本語" + # "ÉL QUE SE ENTERÓ".mb_chars.titleize.to_s # => "Él Que Se Enteró" + # "日本語".mb_chars.titleize.to_s # => "日本語" def titleize chars(downcase.to_s.gsub(/\b('?\S)/u) { Unicode.upcase($1) }) end |