class ActiveSupport::Duration

def %(other)

Numeric values are treated as seconds.
Returns the modulo of this Duration by another Duration or Numeric.
def %(other)
  if Duration === other || Scalar === other
    Duration.build(value % other.value)
  elsif Numeric === other
    Duration.build(value % other)
  else
    raise_type_error(other)
  end
end