Class: Regex::Repetition
- Inherits:
-
MonadicExpression
- Object
- Expression
- CompoundExpression
- MonadicExpression
- Regex::Repetition
- Defined in:
- lib/regex/repetition.rb
Overview
Represents the repetition of a child element. The number of repetitions is constrained by the multiplicity
Instance Attribute Summary collapse
- #multiplicity ⇒ Regex::Multiplicity readonly
Attributes inherited from MonadicExpression
Attributes inherited from Expression
Instance Method Summary collapse
-
#initialize(childExpressionToRepeat, aMultiplicity) ⇒ Repetition
constructor
Constructor.
-
#lazy! ⇒ Object
Apply the
lazy
flag.
Methods inherited from MonadicExpression
Methods inherited from CompoundExpression
Methods inherited from Expression
Constructor Details
#initialize(childExpressionToRepeat, aMultiplicity) ⇒ Repetition
Constructor.
15 16 17 18 |
# File 'lib/regex/repetition.rb', line 15 def initialize(childExpressionToRepeat, aMultiplicity) super(childExpressionToRepeat) @multiplicity = aMultiplicity end |
Instance Attribute Details
#multiplicity ⇒ Regex::Multiplicity (readonly)
10 11 12 |
# File 'lib/regex/repetition.rb', line 10 def multiplicity @multiplicity end |
Instance Method Details
#lazy! ⇒ Object
Apply the lazy
flag.
21 22 23 24 |
# File 'lib/regex/repetition.rb', line 21 def lazy! multiplicity.policy = :lazy super end |