Class: Melbourne::AST::Match2
- 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
-
#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) ⇒ Match2
constructor
A new instance of Match2.
Methods inherited from Node
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
#pattern ⇒ Object
the regex pattern used for the match
248 249 250 |
# File 'lib/melbourne/ast/control_flow.rb', line 248 def pattern @pattern end |
#value ⇒ Object
the value that is matched against the pattern
252 253 254 |
# File 'lib/melbourne/ast/control_flow.rb', line 252 def value @value end |