Class: JekyllRecker::Generators::Words

Inherits:
Jekyll::Generator
  • Object
show all
Includes:
Stats
Defined in:
lib/jekyll_recker/generators.rb

Overview

Word Count Generator

Constant Summary collapse

KEY =
'words'

Instance Method Summary collapse

Methods included from Stats

#average, #entries, #generate, #key, #total

Methods included from Mixins::Logging

#logger

Instance Method Details

#crunchObject



110
111
112
113
114
115
116
# File 'lib/jekyll_recker/generators.rb', line 110

def crunch
  total_counts = entries.collect(&:content).map { |c| number_of_words(c) }
  {
    'average' => average(total_counts),
    'total' => total(total_counts)
  }
end