Class: RegexpExamples::QuestionMarkRepeater
- Inherits:
-
BaseRepeater
- Object
- BaseRepeater
- RegexpExamples::QuestionMarkRepeater
- Defined in:
- lib/regexp-examples/repeaters.rb
Overview
When a question mark is used, e.g. ‘/a?/` Equivalent to `/a0,1/`
Instance Attribute Summary
Attributes inherited from BaseRepeater
#group, #max_repeats, #min_repeats
Instance Method Summary collapse
-
#initialize(group) ⇒ QuestionMarkRepeater
constructor
A new instance of QuestionMarkRepeater.
Methods inherited from BaseRepeater
Constructor Details
#initialize(group) ⇒ QuestionMarkRepeater
Returns a new instance of QuestionMarkRepeater.
71 72 73 74 75 |
# File 'lib/regexp-examples/repeaters.rb', line 71 def initialize(group) super @min_repeats = 0 @max_repeats = 1 end |