Class: Time
- Inherits:
-
Object
- Object
- Time
- Defined in:
- lib/shiftly/core_ext/time.rb
Instance Method Summary collapse
Instance Method Details
#shift ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/shiftly/core_ext/time.rb', line 2 def shift if self.hour < Shiftly::Config.day_start_hour 3 elsif self.hour < Shiftly::Config.day_start_hour + Shiftly::Config.shift_hours 1 elsif self.hour < Shiftly::Config.day_start_hour + 2 * Shiftly::Config.shift_hours 2 else 3 end end |
#shift_beg ⇒ Object
14 15 16 |
# File 'lib/shiftly/core_ext/time.rb', line 14 def shift_beg Time.new(self.year, self.month, self.day, Shiftly::Config.day_start_hour + ((shift - 1) * Shiftly::Config.shift_hours), 0, 0) end |