Module: JekyllReadTime
- Defined in:
- lib/jekyll-read-time.rb,
lib/jekyll-read-time/filter.rb,
lib/jekyll-read-time/version.rb
Defined Under Namespace
Modules: ReadingTimeFilter, ReadingTimeFilterShort
Constant Summary collapse
- WORD_PER_MINUTE =
180- VERSION =
"0.1.0".freeze
Instance Method Summary collapse
Instance Method Details
#calculate_time(input) ⇒ Object
7 8 9 10 11 |
# File 'lib/jekyll-read-time/filter.rb', line 7 def calculate_time( input ) words = input.split.size; minutes = ( words / WORD_PER_MINUTE ).floor return minutes end |