Class: TwitterCldr::Parsers::UnicodeRegexParser::CharacterSet
- Inherits:
-
Component
- Object
- Component
- TwitterCldr::Parsers::UnicodeRegexParser::CharacterSet
- Defined in:
- lib/twitter_cldr/parsers/unicode_regex/character_set.rb
Overview
Can exist inside and outside of character classes
Instance Attribute Summary collapse
-
#property ⇒ Object
readonly
Returns the value of attribute property.
-
#property_value ⇒ Object
readonly
Returns the value of attribute property_value.
Instance Method Summary collapse
-
#initialize(text) ⇒ CharacterSet
constructor
A new instance of CharacterSet.
- #to_regexp_str ⇒ Object
- #to_set ⇒ Object
Constructor Details
#initialize(text) ⇒ CharacterSet
Returns a new instance of CharacterSet.
15 16 17 18 19 20 21 22 |
# File 'lib/twitter_cldr/parsers/unicode_regex/character_set.rb', line 15 def initialize(text) if (name_parts = text.split("=")).size == 2 @property = name_parts[0].downcase @property_value = name_parts[1].to_sym else @property_value = text end end |
Instance Attribute Details
#property ⇒ Object (readonly)
Returns the value of attribute property.
13 14 15 |
# File 'lib/twitter_cldr/parsers/unicode_regex/character_set.rb', line 13 def property @property end |
#property_value ⇒ Object (readonly)
Returns the value of attribute property_value.
13 14 15 |
# File 'lib/twitter_cldr/parsers/unicode_regex/character_set.rb', line 13 def property_value @property_value end |
Instance Method Details
#to_regexp_str ⇒ Object
24 25 26 |
# File 'lib/twitter_cldr/parsers/unicode_regex/character_set.rb', line 24 def to_regexp_str set_to_regex(to_set) end |
#to_set ⇒ Object
28 29 30 31 32 |
# File 'lib/twitter_cldr/parsers/unicode_regex/character_set.rb', line 28 def to_set codepoints.subtract( TwitterCldr::Shared::UnicodeRegex.invalid_regexp_chars ) end |