Module: ClockworkWeb::HomeHelper
- Defined in:
- app/helpers/clockwork_web/home_helper.rb
Instance Method Summary collapse
Instance Method Details
#friendly_period(period) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/helpers/clockwork_web/home_helper.rb', line 4 def friendly_period(period) if period % 1.day == 0 pluralize(period / 1.day, "day") elsif period % 1.hour == 0 pluralize(period / 1.hour, "hour") elsif period % 1.minute == 0 "#{period / 1.minute} min" else "#{period} sec" end end |
#friendly_time_part(time_part) ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/helpers/clockwork_web/home_helper.rb', line 22 def friendly_time_part(time_part) if time_part time_part.to_s.rjust(2, "0") else "**" end end |
#last_run(time) ⇒ Object
16 17 18 19 20 |
# File 'app/helpers/clockwork_web/home_helper.rb', line 16 def last_run(time) if time time_ago_in_words(time) end end |