+(other)
public
Show source
def +(other)
if Duration === other
parts = @parts.dup
other.parts.each do |(key, value)|
parts[key] += value
end
Duration.new(value + other.value, parts)
else
seconds = @parts[:seconds] + other
Duration.new(value + other, @parts.merge(seconds: seconds))
end
end