Module: Compass::Core::SassExtensions::Functions::GradientSupport::Gradient

Includes:
Sass::Script::Value::Helpers
Included in:
LinearGradient, RadialGradient
Defined in:
lib/compass/core/sass_extensions/functions/gradient_support.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



232
233
234
# File 'lib/compass/core/sass_extensions/functions/gradient_support.rb', line 232

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#angle?(value) ⇒ Boolean

Returns:

  • (Boolean)


262
263
264
265
266
267
# File 'lib/compass/core/sass_extensions/functions/gradient_support.rb', line 262

def angle?(value)
  value.is_a?(Sass::Script::Value::Number) &&
  value.numerator_units.size == 1 &&
  value.numerator_units.first == "deg" &&
  value.denominator_units.empty?
end

#has_aspect?Boolean

Returns:

  • (Boolean)


254
255
256
# File 'lib/compass/core/sass_extensions/functions/gradient_support.rb', line 254

def has_aspect?
  true
end

#inspectObject



246
247
248
# File 'lib/compass/core/sass_extensions/functions/gradient_support.rb', line 246

def inspect
  to_s
end

#is_position(pos) ⇒ Object



258
259
260
# File 'lib/compass/core/sass_extensions/functions/gradient_support.rb', line 258

def is_position(pos)
  pos.value =~ Compass::Core::SassExtensions::Functions::Constants::POSITIONS
end

#supports?(aspect) ⇒ Boolean

Returns:

  • (Boolean)


250
251
252
# File 'lib/compass/core/sass_extensions/functions/gradient_support.rb', line 250

def supports?(aspect)
  GRADIENT_ASPECTS.include?(aspect)
end