Parent

Class/Module Index [+]

Quicksearch

Compass::SassExtensions::Functions::GradientSupport::ColorStop

Attributes

color[RW]
stop[RW]

Public Class Methods

new(color, stop = nil) click to toggle source
# File lib/compass/sass_extensions/functions/gradient_support.rb, line 10
def initialize(color, stop = nil)
  unless Sass::Script::Color === color || Sass::Script::Funcall === color
    raise Sass::SyntaxError, "Expected a color. Got: #{color}"
  end
  if stop && !stop.is_a?(Sass::Script::Number)
    raise Sass::SyntaxError, "Expected a number. Got: #{stop}"
  end
  self.color, self.stop = color, stop
end

Public Instance Methods

children() click to toggle source
# File lib/compass/sass_extensions/functions/gradient_support.rb, line 7
def children
  [color, stop].compact
end
inspect() click to toggle source
# File lib/compass/sass_extensions/functions/gradient_support.rb, line 19
def inspect
  to_s
end
to_s(options = self.options) click to toggle source
# File lib/compass/sass_extensions/functions/gradient_support.rb, line 22
def to_s(options = self.options)
  s = color.inspect.dup
  if stop
    s << " "
    if stop.unitless?
      s << stop.times(Sass::Script::Number.new(100, ["%"])).inspect
    else
      s << stop.inspect
    end
  end
  s
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.