Class: Strling::Core::IRClassRange
- Inherits:
-
IRClassItem
- Object
- IRClassItem
- Strling::Core::IRClassRange
- Defined in:
- lib/strling/core/ir.rb
Overview
Represents a character range in a character class in the IR.
Matches characters from from_ch to to_ch (inclusive).
Instance Attribute Summary collapse
-
#from_ch ⇒ String
The starting character.
-
#to_ch ⇒ String
The ending character.
Instance Method Summary collapse
-
#initialize(from_ch, to_ch) ⇒ IRClassRange
constructor
A new instance of IRClassRange.
- #to_dict ⇒ Object
Constructor Details
#initialize(from_ch, to_ch) ⇒ IRClassRange
Returns a new instance of IRClassRange.
136 137 138 139 |
# File 'lib/strling/core/ir.rb', line 136 def initialize(from_ch, to_ch) @from_ch = from_ch @to_ch = to_ch end |
Instance Attribute Details
#from_ch ⇒ String
Returns The starting character.
129 130 131 |
# File 'lib/strling/core/ir.rb', line 129 def from_ch @from_ch end |
#to_ch ⇒ String
Returns The ending character.
132 133 134 |
# File 'lib/strling/core/ir.rb', line 132 def to_ch @to_ch end |
Instance Method Details
#to_dict ⇒ Object
141 142 143 |
# File 'lib/strling/core/ir.rb', line 141 def to_dict { 'ir' => 'Range', 'from' => from_ch, 'to' => to_ch } end |