Class: Strling::Core::IRClassEscape
- Inherits:
-
IRClassItem
- Object
- IRClassItem
- Strling::Core::IRClassEscape
- Defined in:
- lib/strling/core/ir.rb
Overview
Represents an escape sequence in a character class in the IR.
Matches predefined character classes or Unicode properties.
Instance Attribute Summary collapse
-
#property ⇒ String?
The Unicode property name (for p and P).
-
#type ⇒ String
The escape type.
Instance Method Summary collapse
-
#initialize(type, property: nil) ⇒ IRClassEscape
constructor
A new instance of IRClassEscape.
- #to_dict ⇒ Object
Constructor Details
#initialize(type, property: nil) ⇒ IRClassEscape
Returns a new instance of IRClassEscape.
175 176 177 178 |
# File 'lib/strling/core/ir.rb', line 175 def initialize(type, property: nil) @type = type @property = property end |
Instance Attribute Details
#property ⇒ String?
Returns The Unicode property name (for p and P).
171 172 173 |
# File 'lib/strling/core/ir.rb', line 171 def property @property end |
#type ⇒ String
Returns The escape type.
168 169 170 |
# File 'lib/strling/core/ir.rb', line 168 def type @type end |
Instance Method Details
#to_dict ⇒ Object
180 181 182 183 184 |
# File 'lib/strling/core/ir.rb', line 180 def to_dict data = { 'ir' => 'Esc', 'type' => type } data['property'] = property if property data end |