Class: JekyllRecker::Entry
- Inherits:
-
Object
- Object
- JekyllRecker::Entry
- Defined in:
- lib/jekyll_recker/entry.rb
Overview
Entry
Instance Method Summary collapse
- #content ⇒ Object
- #date ⇒ Object
-
#initialize(doc) ⇒ Entry
constructor
A new instance of Entry.
- #word_count ⇒ Object
- #words ⇒ Object
Constructor Details
#initialize(doc) ⇒ Entry
Returns a new instance of Entry.
6 7 8 |
# File 'lib/jekyll_recker/entry.rb', line 6 def initialize(doc) @doc = doc end |
Instance Method Details
#content ⇒ Object
10 11 12 |
# File 'lib/jekyll_recker/entry.rb', line 10 def content @doc.content end |
#date ⇒ Object
14 15 16 |
# File 'lib/jekyll_recker/entry.rb', line 14 def date @date ||= ::Date.parse(@doc.date.strftime('%Y-%m-%d')) end |
#word_count ⇒ Object
25 26 27 |
# File 'lib/jekyll_recker/entry.rb', line 25 def word_count @word_count ||= words.size end |
#words ⇒ Object
18 19 20 21 22 23 |
# File 'lib/jekyll_recker/entry.rb', line 18 def words content.split.map do |token| token.gsub!(/[^0-9a-z ]/i, '') token.downcase end end |