aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/multibyte/chars.rb
diff options
context:
space:
mode:
authorNorman Clarke <norman@njclarke.com>2012-01-05 17:20:15 -0300
committerNorman Clarke <norman@njclarke.com>2012-01-05 17:20:15 -0300
commitdb6eb1930d5e31d08e2cc613ad0570d0d1bb0730 (patch)
tree76ebe6d6de51668923474439b3301be22404f397 /activesupport/lib/active_support/multibyte/chars.rb
parent4ac056c7f46fa6961699402d0bf296dac6a02384 (diff)
downloadrails-db6eb1930d5e31d08e2cc613ad0570d0d1bb0730.tar.gz
rails-db6eb1930d5e31d08e2cc613ad0570d0d1bb0730.tar.bz2
rails-db6eb1930d5e31d08e2cc613ad0570d0d1bb0730.zip
Use friendlier method names for upcasing/downcasing
Diffstat (limited to 'activesupport/lib/active_support/multibyte/chars.rb')
-rw-r--r--activesupport/lib/active_support/multibyte/chars.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/multibyte/chars.rb b/activesupport/lib/active_support/multibyte/chars.rb
index a6256d0c47..eb7f99dd71 100644
--- a/activesupport/lib/active_support/multibyte/chars.rb
+++ b/activesupport/lib/active_support/multibyte/chars.rb
@@ -107,7 +107,7 @@ module ActiveSupport #:nodoc:
# Example:
# 'Laurent, où sont les tests ?'.mb_chars.upcase.to_s # => "LAURENT, OÙ SONT LES TESTS ?"
def upcase
- chars(Unicode.apply_mapping @wrapped_string, :uppercase_mapping)
+ chars Unicode.upcase(@wrapped_string)
end
# Convert characters in the string to lowercase.
@@ -115,7 +115,7 @@ module ActiveSupport #:nodoc:
# Example:
# 'VĚDA A VÝZKUM'.mb_chars.downcase.to_s # => "věda a výzkum"
def downcase
- chars(Unicode.apply_mapping @wrapped_string, :lowercase_mapping)
+ chars Unicode.downcase(@wrapped_string)
end
# Converts the first character to uppercase and the remainder to lowercase.
@@ -132,7 +132,7 @@ module ActiveSupport #:nodoc:
# "ÉL QUE SE ENTERÓ".mb_chars.titleize # => "Él Que Se Enteró"
# "日本語".mb_chars.titleize # => "日本語"
def titleize
- chars(downcase.to_s.gsub(/\b('?[\S])/u) { Unicode.apply_mapping $1, :uppercase_mapping })
+ chars(downcase.to_s.gsub(/\b('?[\S])/u) { Unicode.upcase($1)})
end
alias_method :titlecase, :titleize