Class: Regex::Repetition

Inherits:
MonadicExpression show all
Defined in:
lib/regex/repetition.rb

Overview

Abstract class. An unary matching operator. It succeeds when the specified repetition of the child expression succeeds to match the subject text in the same serial arrangement

Instance Attribute Summary collapse

Attributes inherited from MonadicExpression

#child

Attributes inherited from Expression

#begin_anchor, #end_anchor

Instance Method Summary collapse

Methods inherited from CompoundExpression

#atomic?

Methods inherited from Expression

#atomic?, #cardinality, #options, #to_str

Constructor Details

#initialize(childExpressionToRepeat, aMultiplicity) ⇒ Repetition

Constructor.



13
14
15
16
# File 'lib/regex/repetition.rb', line 13

def initialize(childExpressionToRepeat, aMultiplicity)
  super(childExpressionToRepeat)
  @multiplicity = aMultiplicity
end

Instance Attribute Details

#multiplicityObject (readonly)

Returns the value of attribute multiplicity.



10
11
12
# File 'lib/regex/repetition.rb', line 10

def multiplicity
  @multiplicity
end