Class: RegexpExamples::OneTimeRepeater
- Inherits:
-
BaseRepeater
- Object
- BaseRepeater
- RegexpExamples::OneTimeRepeater
- Defined in:
- lib/regexp-examples/repeaters.rb
Overview
When there is “no repeater”, we interpret this as a “one time repeater”. For example, ‘/a/` is a “OneTimeRepeater” of “a” Equivalent to `/a1/`
Instance Attribute Summary
Attributes inherited from BaseRepeater
#group, #max_repeats, #min_repeats
Instance Method Summary collapse
-
#initialize(group) ⇒ OneTimeRepeater
constructor
A new instance of OneTimeRepeater.
Methods inherited from BaseRepeater
Constructor Details
#initialize(group) ⇒ OneTimeRepeater
Returns a new instance of OneTimeRepeater.
41 42 43 44 45 |
# File 'lib/regexp-examples/repeaters.rb', line 41 def initialize(group) super @min_repeats = 1 @max_repeats = 1 end |