Sass::Script::Literal
# File lib/compass/sass_extensions/functions/gradient_support.rb, line 24 def self.color_to_s(c) if c.is_a?(Sass::Script::String) c.value.dup else c.inspect.dup end end
# 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 || (Sass::Script::String === color && color.value == "transparent") 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
# File lib/compass/sass_extensions/functions/gradient_support.rb, line 7 def children [color, stop].compact end
# File lib/compass/sass_extensions/functions/gradient_support.rb, line 21 def inspect to_s end
# File lib/compass/sass_extensions/functions/gradient_support.rb, line 32 def to_s(options = self.options) s = self.class.color_to_s(color) if stop s << " " if stop.unitless? s << stop.times(Sass::Script::Number.new(100, ["%"])).inspect else s << stop.inspect end end s end
Generated with the Darkfish Rdoc Generator 2.