Method: TimeCalc::Diff#modulo
- Defined in:
- lib/time_calc/diff.rb
#modulo(span, unit) ⇒ Time, Date or DateTime #modulo(unit) ⇒ Time, Date or DateTime Also known as: %
Same as integer modulo: the “rest” of whole division of the distance between two time points by ‘<span> <units>`. This rest will be also time point, equal to `first diff operand - span units`
132 133 134 |
# File 'lib/time_calc/diff.rb', line 132 def modulo(span, unit = nil) divmod(span, unit).last end |