Class: Strling::Core::ClassRange
- Defined in:
- lib/strling/core/nodes.rb
Overview
Represents a character range in a character class.
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) ⇒ ClassRange
constructor
A new instance of ClassRange.
- #to_dict ⇒ Object
Constructor Details
#initialize(from_ch, to_ch) ⇒ ClassRange
Returns a new instance of ClassRange.
228 229 230 231 |
# File 'lib/strling/core/nodes.rb', line 228 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.
221 222 223 |
# File 'lib/strling/core/nodes.rb', line 221 def from_ch @from_ch end |
#to_ch ⇒ String
Returns The ending character.
224 225 226 |
# File 'lib/strling/core/nodes.rb', line 224 def to_ch @to_ch end |
Instance Method Details
#to_dict ⇒ Object
233 234 235 |
# File 'lib/strling/core/nodes.rb', line 233 def to_dict { 'kind' => 'Range', 'from' => from_ch, 'to' => to_ch } end |