instance method
%
Ruby on Rails 7.1.6
Since v5.2.8.1Signature
%(other)
Returns the modulo of this Duration by another Duration or Numeric. Numeric values are treated as seconds.
Parameters
-
otherreq
Source
# File activesupport/lib/active_support/duration.rb, line 307
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
Defined in activesupport/lib/active_support/duration.rb line 307
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Duration