From 1afe1aeba528249fc6be8bda4dad6a4dd243646d Mon Sep 17 00:00:00 2001 From: Hitendra Singh Date: Fri, 20 Sep 2013 12:37:51 +0530 Subject: Initializing Codepoint object with default values --- activesupport/lib/active_support/multibyte/unicode.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activesupport/lib/active_support') 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 -- cgit v1.2.3