Class: Wordlist::Modifiers::MutateCase

Inherits:
Mutate show all
Defined in:
lib/wordlist/modifiers/mutate_case.rb

Overview

Lazily enumerates through every possible upper/lower-case variation of each word in the wordlist.

Since:

  • 1.0.0

Instance Attribute Summary

Attributes inherited from Sub

#block, #pattern, #replace

Attributes inherited from Modifier

#wordlist

Instance Method Summary collapse

Methods inherited from Mutate

#each

Methods inherited from Sub

#each

Methods inherited from Modifier

#each

Constructor Details

#initialize(wordlist) ⇒ MutateCase

Initializes the case mutator.

Parameters:

  • wordlist (Enumerable)

    The wordlist to modify.

Since:

  • 1.0.0



20
21
22
# File 'lib/wordlist/modifiers/mutate_case.rb', line 20

def initialize(wordlist)
  super(wordlist,/[[:alpha:]]/) { |letter| letter.swapcase }
end