Class: TwitterCldr::Parsers::UnicodeRegexParser::CharacterClass
- Inherits:
-
Component
- Object
- Component
- TwitterCldr::Parsers::UnicodeRegexParser::CharacterClass
show all
- Defined in:
- lib/twitter_cldr/parsers/unicode_regex/character_class.rb
Overview
This is analogous to ICU’s UnicodeSet class.
Defined Under Namespace
Classes: BinaryOperator, UnaryOperator
Constant Summary
collapse
- GROUPING_PAIRS =
{
close_bracket: :open_bracket
}
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of CharacterClass.
37
38
39
|
# File 'lib/twitter_cldr/parsers/unicode_regex/character_class.rb', line 37
def initialize(root)
@root = root
end
|
Class Method Details
.closing_types ⇒ Object
27
28
29
|
# File 'lib/twitter_cldr/parsers/unicode_regex/character_class.rb', line 27
def closing_types
@closing_types ||= GROUPING_PAIRS.keys
end
|
.opening_type_for(type) ⇒ Object
31
32
33
|
# File 'lib/twitter_cldr/parsers/unicode_regex/character_class.rb', line 31
def opening_type_for(type)
GROUPING_PAIRS[type]
end
|
.opening_types ⇒ Object
23
24
25
|
# File 'lib/twitter_cldr/parsers/unicode_regex/character_class.rb', line 23
def opening_types
@opening_types ||= GROUPING_PAIRS.values
end
|
Instance Method Details
#codepoints ⇒ Object
53
54
55
|
# File 'lib/twitter_cldr/parsers/unicode_regex/character_class.rb', line 53
def codepoints
codepoints_from(root)
end
|
#to_regexp_str ⇒ Object
45
46
47
|
# File 'lib/twitter_cldr/parsers/unicode_regex/character_class.rb', line 45
def to_regexp_str
set_to_regex(to_set)
end
|
#to_s ⇒ Object
57
58
59
|
# File 'lib/twitter_cldr/parsers/unicode_regex/character_class.rb', line 57
def to_s
stringify(root)
end
|
#to_set ⇒ Object
49
50
51
|
# File 'lib/twitter_cldr/parsers/unicode_regex/character_class.rb', line 49
def to_set
evaluate(root)
end
|
#type ⇒ Object
41
42
43
|
# File 'lib/twitter_cldr/parsers/unicode_regex/character_class.rb', line 41
def type
:character_class
end
|