Class: Wordlist::Modifiers::Modifier
- Inherits:
-
Object
- Object
- Wordlist::Modifiers::Modifier
- Includes:
- Enumerable
- Defined in:
- lib/wordlist/modifiers/modifier.rb
Overview
Modifier base class.
Direct Known Subclasses
Capitalize, Downcase, Sub, Tr, Upcase
Instance Attribute Summary collapse
-
#wordlist ⇒ Enumerable
readonly
The wordlist to modify.
Instance Method Summary collapse
-
#each {|word| ... } ⇒ Enumerator
abstract
Enumerates over every modification of every word in the wordlist.
-
#initialize(wordlist) ⇒ Modifier
constructor
Initializes the modifier.
Constructor Details
#initialize(wordlist) ⇒ Modifier
Initializes the modifier.
23 24 25 |
# File 'lib/wordlist/modifiers/modifier.rb', line 23 def initialize(wordlist) @wordlist = wordlist end |
Instance Attribute Details
#wordlist ⇒ Enumerable (readonly)
The wordlist to modify.
15 16 17 |
# File 'lib/wordlist/modifiers/modifier.rb', line 15 def wordlist @wordlist end |
Instance Method Details
#each {|word| ... } ⇒ Enumerator
This method is abstract.
Enumerates over every modification of every word in the wordlist.
38 39 40 |
# File 'lib/wordlist/modifiers/modifier.rb', line 38 def each(&block) raise(NotImplementedError,"#{self.class}##{__method__} was not implemented") end |