class Regexp::Expression::Conditional::Condition

Attributes

referenced_expression[RW]

Public Instance Methods

reference() click to toggle source

Name or number of the referenced capturing group that determines state. Returns a String if reference is by name, Integer if by number.

# File lib/regexp_parser/expression/classes/conditional.rb, line 14
def reference
  ref = text.tr("'<>()", "")
  ref =~ /\D/ ? ref : Integer(ref)
end