Class: Melbourne::AST::Match2

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

Overview

A regular expression match statement with the regular expression pattern as the receiver as in:

/x/ =~ x

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph

Constructor Details

#initialize(line, pattern, value) ⇒ Match2

Returns a new instance of Match2.



254
255
256
257
258
# File 'lib/melbourne/ast/control_flow.rb', line 254

def initialize(line, pattern, value)
  @line = line
  @pattern = pattern
  @value = value
end

Instance Attribute Details

#patternObject

the regex pattern used for the match



248
249
250
# File 'lib/melbourne/ast/control_flow.rb', line 248

def pattern
  @pattern
end

#valueObject

the value that is matched against the pattern



252
253
254
# File 'lib/melbourne/ast/control_flow.rb', line 252

def value
  @value
end