Class: RegexpExamples::PlusRepeater

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

Overview

When a plus is used, e.g. ‘/a+/` Equivalent to `/a1,/`

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) ⇒ PlusRepeater

Returns a new instance of PlusRepeater.



61
62
63
64
65
# File 'lib/regexp-examples/repeaters.rb', line 61

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