class Sass::Value::Calculation
@see sass-lang.com/documentation/js-api/classes/sasscalculation/
Sass’s calculation type.
def ==(other)
-
(::Boolean)
-
def ==(other) other.is_a?(Sass::Value::Calculation) && other.name == name && other.arguments == arguments end
def assert_calculation(_name = nil)
-
(Calculation)
-
def assert_calculation(_name = nil) self end
def calc(argument)
-
(Calculation)
-
Parameters:
-
argument
(CalculationValue
) --
def calc(argument) new('calc', [argument]) end
def clamp(min, value = nil, max = nil)
-
(Calculation)
-
Parameters:
-
max
(CalculationValue
) -- -
value
(CalculationValue
) -- -
min
(CalculationValue
) --
def clamp(min, value = nil, max = nil) if (value.nil? && !valid_clamp_arg?(min)) || (max.nil? && [min, value].none? { |x| x && valid_clamp_arg?(x) }) raise Sass::ScriptError, 'Argument must be an unquoted SassString.' end new('clamp', [min, value, max].compact) end
def hash
-
(Integer)
-
def hash @hash ||= [name, *arguments].hash end
def initialize(name, arguments)
def initialize(name, arguments) arguments.each do |value| assert_calculation_value(value) end @name = name.freeze @arguments = arguments.freeze end
def max(arguments)
-
(Calculation)
-
Parameters:
-
arguments
(Array
) --
def max(arguments) new('max', arguments) end
def min(arguments)
-
(Calculation)
-
Parameters:
-
arguments
(Array
) --
def min(arguments) new('min', arguments) end
def valid_clamp_arg?(value)
def valid_clamp_arg?(value) value.is_a?(Sass::Value::String) && !value.quoted? end