class Regexp::Expression::Conditional::Condition

Attributes

referenced_expression[RW]

Public Instance Methods

initialize_copy(orig) click to toggle source
# File lib/regexp_parser/expression/classes/conditional.rb, line 19
def initialize_copy(orig)
  self.referenced_expression = orig.referenced_expression.dup
  super
end
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