Class: Spellr::WordlistReporter
- Inherits:
-
Object
- Object
- Spellr::WordlistReporter
- Defined in:
- lib/spellr/wordlist_reporter.rb
Instance Attribute Summary collapse
-
#words ⇒ Object
readonly
Returns the value of attribute words.
Instance Method Summary collapse
- #call(token) ⇒ Object
- #finish(_checked) ⇒ Object
-
#initialize ⇒ WordlistReporter
constructor
A new instance of WordlistReporter.
Constructor Details
#initialize ⇒ WordlistReporter
Returns a new instance of WordlistReporter.
9 10 11 |
# File 'lib/spellr/wordlist_reporter.rb', line 9 def initialize @words = Set.new end |
Instance Attribute Details
#words ⇒ Object (readonly)
Returns the value of attribute words.
7 8 9 |
# File 'lib/spellr/wordlist_reporter.rb', line 7 def words @words end |
Instance Method Details
#call(token) ⇒ Object
17 18 19 |
# File 'lib/spellr/wordlist_reporter.rb', line 17 def call(token) words << token.normalize end |
#finish(_checked) ⇒ Object
13 14 15 |
# File 'lib/spellr/wordlist_reporter.rb', line 13 def finish(_checked) puts words.sort.join end |