Class: Melbourne::AST::Match3
- 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
-
#pattern ⇒ Object
the regex pattern used for the match.
-
#value ⇒ Object
the value that is matched against the
pattern.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, pattern, value) ⇒ Match3
constructor
A new instance of Match3.
Methods inherited from Node
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
#pattern ⇒ Object
the regex pattern used for the match
270 271 272 |
# File 'lib/melbourne/ast/control_flow.rb', line 270 def pattern @pattern end |
#value ⇒ Object
the value that is matched against the pattern
274 275 276 |
# File 'lib/melbourne/ast/control_flow.rb', line 274 def value @value end |