Class: Spellr::WordlistReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/spellr/wordlist_reporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWordlistReporter

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

#wordsObject (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