1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Initializing Codepoint object with default values

This commit is contained in:
Hitendra Singh 2013-09-20 12:37:51 +05:30
parent 5923ae6321
commit 1afe1aeba5
2 changed files with 7 additions and 6 deletions

View file

@ -28,12 +28,6 @@ module ActiveSupport
def initialize
@ucd = Unicode::UnicodeDatabase.new
default = Codepoint.new
default.combining_class = 0
default.uppercase_mapping = 0
default.lowercase_mapping = 0
@ucd.codepoints = Hash.new(default)
end
def parse_codepoints(line)

View file

@ -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