Method: Wordlist::Modifiers::Sub#each
- Defined in:
- lib/wordlist/modifiers/sub.rb
#each {|word| ... } ⇒ Enumerator
Enumerates over every subed word in the wordlist.
82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/wordlist/modifiers/sub.rb', line 82 def each return enum_for(__method__) unless block_given? if @replace @wordlist.each do |word| yield word.sub(@pattern,@replace) end else @wordlist.each do |word| yield word.sub(@pattern,&block) end end end |