Class: Strling::Core::ClassLiteral
- Defined in:
- lib/strling/core/nodes.rb
Overview
Represents a literal character in a character class.
Matches the exact character.
Instance Attribute Summary collapse
-
#ch ⇒ String
The character.
Instance Method Summary collapse
-
#initialize(ch) ⇒ ClassLiteral
constructor
A new instance of ClassLiteral.
- #to_dict ⇒ Object
Constructor Details
#initialize(ch) ⇒ ClassLiteral
Returns a new instance of ClassLiteral.
246 247 248 |
# File 'lib/strling/core/nodes.rb', line 246 def initialize(ch) @ch = ch end |
Instance Attribute Details
#ch ⇒ String
Returns The character.
243 244 245 |
# File 'lib/strling/core/nodes.rb', line 243 def ch @ch end |
Instance Method Details
#to_dict ⇒ Object
250 251 252 |
# File 'lib/strling/core/nodes.rb', line 250 def to_dict { 'kind' => 'Char', 'char' => ch } end |