Method: ActiveSupport::Duration#*
- Defined in:
- activesupport/lib/active_support/duration.rb
#*(other) ⇒ Object
Multiplies this Duration by a Numeric and returns a new Duration.
287 288 289 290 291 292 293 294 295 |
# File 'activesupport/lib/active_support/duration.rb', line 287 def *(other) if Scalar === other || Duration === other Duration.new(value * other.value, @parts.transform_values { |number| number * other.value }, @variable || other.variable?) elsif Numeric === other Duration.new(value * other, @parts.transform_values { |number| number * other }, @variable) else raise_type_error(other) end end |