Class: Strling::Core::Lit

Inherits:
Node
  • Object
show all
Defined in:
lib/strling/core/nodes.rb

Overview

Represents a literal string match.

Matches the exact string value provided.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Lit

Returns a new instance of Lit.

Parameters:

  • value (String)

    The literal string value



146
147
148
# File 'lib/strling/core/nodes.rb', line 146

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueString

Returns The literal string value.

Returns:

  • (String)

    The literal string value



143
144
145
# File 'lib/strling/core/nodes.rb', line 143

def value
  @value
end

Instance Method Details

#to_dictObject



150
151
152
# File 'lib/strling/core/nodes.rb', line 150

def to_dict
  { 'kind' => 'Lit', 'value' => value }
end