Class: Melbourne::AST::NthRef

Inherits:
Node
  • Object
show all
Defined in:
lib/melbourne/ast/variables.rb

Overview

A reference to the nth match in a regular expression match result as in:

$1

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph

Constructor Details

#initialize(line, ref) ⇒ NthRef



36
37
38
39
# File 'lib/melbourne/ast/variables.rb', line 36

def initialize(line, ref)
  @line = line
  @which = ref
end

Instance Attribute Details

#whichObject

The number of the match that is referenced



34
35
36
# File 'lib/melbourne/ast/variables.rb', line 34

def which
  @which
end