Method: ActiveSupport::Duration#%
- Defined in:
- lib/active_support/duration.rb
#%(other) ⇒ Object
Returns the modulo of this Duration by another Duration or Numeric. Numeric values are treated as seconds.
312 313 314 315 316 317 318 319 320 |
# File 'lib/active_support/duration.rb', line 312 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 |