Method: Sass::Script::Value::Number#times

Defined in:
lib/sass/script/value/number.rb

#times(other) ⇒ Number, Color

The SassScript * operation. Its functionality depends on the type of its argument:

Sass::Script::Value::Number : Multiplies the two numbers together, converting units appropriately.

Color : Multiplies each of the RGB color channels by this number.

Parameters:

  • other (Number, Color)

    The right-hand side of the operator

Returns:

Raises:

  • (NoMethodError)

    if other is an invalid type



151
152
153
154
155
156
157
158
159
# File 'lib/sass/script/value/number.rb', line 151

def times(other)
  if other.is_a? Number
    operate(other, :*)
  elsif other.is_a? Color
    other.times(self)
  else
    raise NoMethodError.new(nil, :times)
  end
end