Class: RegexpExamples::StarRepeater

Inherits:
BaseRepeater show all
Defined in:
lib/regexp-examples/repeaters.rb

Overview

When a klein star is used, e.g. ‘/a*/` Equivalent to `/a0,/`

Instance Attribute Summary

Attributes inherited from BaseRepeater

#group, #max_repeats, #min_repeats

Instance Method Summary collapse

Methods inherited from BaseRepeater

#random_result, #result

Constructor Details

#initialize(group) ⇒ StarRepeater

Returns a new instance of StarRepeater.



51
52
53
54
55
# File 'lib/regexp-examples/repeaters.rb', line 51

def initialize(group)
  super
  @min_repeats = 0
  @max_repeats = RegexpExamples::Config.max_repeater_variance
end