reading_time

in lib/helpers/reading_time.rb [22:30]


    def reading_time(words)
      minutes = (words / WPM).ceil
      seconds = (words % WPM / (WPM / 60)).floor

      minutes += 1 if seconds.positive?

      (minutes <= 1 ? 'about a minute' : "~#{minutes} minutes")
    end