Module: Lexdrill::LineFormatter

Defined in:
lib/lexdrill/line_formatter.rb

Overview

Formats a shown word as "line_number/total:\tword". The just-advanced counter value equals the 1-based position of the word that was shown.

Class Method Summary collapse

Class Method Details

.format(word) ⇒ Object



6
7
8
9
10
# File 'lib/lexdrill/line_formatter.rb', line 6

def self.format(word)
  total = Lexdrill::WordList.words.size
  line_number = Lexdrill::Counter.new(Lexdrill::WordList::COUNTER_PATH).value
  "#{line_number}/#{total}:\t#{word}"
end