diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2013-09-20 07:29:38 -0700 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2013-09-20 07:29:38 -0700 |
commit | 218c089ae7fd997fda23cc604f18df95c58d31b0 (patch) | |
tree | 4a118590a374e5a490e9c4cdfded617250afa50b /activesupport/lib/active_support/multibyte/unicode.rb | |
parent | 76d36458eadcb32c233f44065fccfbbef9a58119 (diff) | |
parent | 1afe1aeba528249fc6be8bda4dad6a4dd243646d (diff) | |
download | rails-218c089ae7fd997fda23cc604f18df95c58d31b0.tar.gz rails-218c089ae7fd997fda23cc604f18df95c58d31b0.tar.bz2 rails-218c089ae7fd997fda23cc604f18df95c58d31b0.zip |
Merge pull request #12299 from hitendrasingh/code_refactor
DRYing up method_missing code; Initializing Codepoint object with default values
Diffstat (limited to 'activesupport/lib/active_support/multibyte/unicode.rb')
-rw-r--r-- | activesupport/lib/active_support/multibyte/unicode.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/multibyte/unicode.rb b/activesupport/lib/active_support/multibyte/unicode.rb index 04e6b71580..1845c6ae38 100644 --- a/activesupport/lib/active_support/multibyte/unicode.rb +++ b/activesupport/lib/active_support/multibyte/unicode.rb @@ -287,6 +287,13 @@ module ActiveSupport class Codepoint attr_accessor :code, :combining_class, :decomp_type, :decomp_mapping, :uppercase_mapping, :lowercase_mapping + # Initializing Codepoint object with default values + def initialize + @combining_class = 0 + @uppercase_mapping = 0 + @lowercase_mapping = 0 + end + def swapcase_mapping uppercase_mapping > 0 ? uppercase_mapping : lowercase_mapping end |