Class: Strling::Core::IRLit

Inherits:
IROp
  • Object
show all
Defined in:
lib/strling/core/ir.rb

Overview

Represents a literal string match in the IR.

Matches the exact string value provided.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ IRLit

Returns a new instance of IRLit.

Parameters:

  • value (String)

    The literal string value



78
79
80
# File 'lib/strling/core/ir.rb', line 78

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueString

Returns The literal string value.

Returns:

  • (String)

    The literal string value



75
76
77
# File 'lib/strling/core/ir.rb', line 75

def value
  @value
end

Instance Method Details

#to_dictObject



82
83
84
# File 'lib/strling/core/ir.rb', line 82

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