Module: PickARecord::TimeExtensions
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/pick_a_record/time_extensions.rb
Overview
Extra methods for the Time class.
Instance Method Summary collapse
-
#as4_seconds_until_end_of_day ⇒ Integer
Number of the seconds until the end of the day.
-
#seconds_until_end_of_week ⇒ Integer
Number of seconds until the end of the week.
Instance Method Details
#as4_seconds_until_end_of_day ⇒ Integer
Note:
Backport of Time#seconds_until_end_of_day from ActiveSupport 4
Returns number of the seconds until the end of the day.
11 12 13 |
# File 'lib/pick_a_record/time_extensions.rb', line 11 def as4_seconds_until_end_of_day end_of_day.to_i - to_i end |
#seconds_until_end_of_week ⇒ Integer
16 17 18 |
# File 'lib/pick_a_record/time_extensions.rb', line 16 def seconds_until_end_of_week end_of_week.to_i - to_i end |