module CssCompare::CSS::ValueFactory
Public Class Methods
create(value)
click to toggle source
Creates the value object by applying the appropriate wrapper class.
@param [Sass::Script::Tree::Node] value the CSS
property’s value @return [CssCompare::CSS::Value::Base] the wrapped property value
# File lib/css_compare/css/value_factory.rb, line 15 def self.create(value) if value.is_a?(Sass::Script::Tree::Literal) Value::Literal.new(value) elsif value.is_a?(Sass::Script::Tree::ListLiteral) Value::ListLiteral.new(value) elsif value.is_a?(Sass::Script::Tree::Funcall) return Value::Function.new(value) unless value.name == 'url' Value::Url.new(value) else raise StandardError, 'Unsupported type of CSS value' end end