Method: ActiveSupport::Duration::Scalar#*

Defined in:
activesupport/lib/active_support/duration.rb

#*(other) ⇒ Object



66
67
68
69
70
71
72
73
74
75
# File 'activesupport/lib/active_support/duration.rb', line 66

def *(other)
  if Duration === other
    new_parts = other._parts.transform_values { |other_value| value * other_value }
    new_value = value * other.value

    Duration.new(new_value, new_parts, other.variable?)
  else
    calculate(:*, other)
  end
end