Class: Melbourne::AST::Match3

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

Overview

A regular expression match statement where a String is matched against the pattern as in:

'some' =~ /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) ⇒ Match3

Returns a new instance of Match3.



276
277
278
279
280
# File 'lib/melbourne/ast/control_flow.rb', line 276

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

Instance Attribute Details

#patternObject

the regex pattern used for the match



270
271
272
# File 'lib/melbourne/ast/control_flow.rb', line 270

def pattern
  @pattern
end

#valueObject

the value that is matched against the pattern



274
275
276
# File 'lib/melbourne/ast/control_flow.rb', line 274

def value
  @value
end