Module: Bunko::Models::PostMethods::WordCountable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Bunko::Models::PostMethods
- Defined in:
- lib/bunko/models/post_methods/word_countable.rb
Instance Method Summary collapse
-
#reading_time ⇒ Object
Instance methods.
- #reading_time_text ⇒ Object
Instance Method Details
#reading_time ⇒ Object
Instance methods
14 15 16 17 18 |
# File 'lib/bunko/models/post_methods/word_countable.rb', line 14 def reading_time return nil unless word_count.present? && word_count > 0 (word_count.to_f / Bunko.configuration.reading_speed).ceil end |
#reading_time_text ⇒ Object
20 21 22 23 24 |
# File 'lib/bunko/models/post_methods/word_countable.rb', line 20 def reading_time_text return nil unless reading_time.present? "#{reading_time} min read" end |