Module: Compass::Core::SassExtensions::Functions::GradientSupport::Assertions

Included in:
LinearGradient, RadialGradient
Defined in:
lib/compass/core/sass_extensions/functions/gradient_support.rb

Instance Method Summary collapse

Instance Method Details

#assert_type(value, type, name = nil) ⇒ Object

Raises:

  • (ArgumentError)


838
839
840
841
842
843
# File 'lib/compass/core/sass_extensions/functions/gradient_support.rb', line 838

def assert_type(value, type, name = nil)
  return if value.is_a?(Sass::Script.const_get(type))
  err = "#{value.inspect} is not a #{type.to_s.downcase}"
  err = "$#{name}: " + err if name
  raise ArgumentError.new(err)
end