class SassC::Script::Value

def ==(other)

Compares this object to `other`
def ==(other)
  self.class == other.class && value == other.value
end

def _perform(environment)

Returns:
  • (Value) - This value

Parameters:
  • environment (Sass::Environment) -- The environment in which to evaluate the SassScript
def _perform(environment)
  self
end

def assert_int!; to_i; end

Raises:
  • (SassC::SyntaxError) - if this value isn't an integer
def assert_int!; to_i; end

def bracketed

this will be `false`.
Whether the value is surrounded by square brackets. For non-list values,
def bracketed
  false
end

def eql?(other)

True if this Value is the same as `other`
def eql?(other)
  self == other
end

def hash

equal if the objects are equal.
Returns the hash code of this value. Two objects' hash codes should be
def hash
  value.hash
end

def initialize(value = nil)

Creates a new value.
def initialize(value = nil)
  value.freeze unless value.nil? || value == true || value == false
  @value = value
  @options = nil
end

def inspect

Returns a system inspect value for this object
def inspect
  value.inspect
end

def null?

Returns `false` (all Values are truthy)
def null?
  false
end

def options

outside of the parser and \{#to\_s} was called on it
Raises SassC::SyntaxError if the value was created
Returns the options hash for this node.
def options
  return @options if @options
  raise SassC::SyntaxError.new("The #options attribute is not set on this #{self.class}. This error is probably occurring because #to_s was called on this value within a custom Sass function without first setting the #options attribute.")
end

def separator

empty list, this will be `nil`. For lists or maps, it will be `:space` or `:comma`.
Returns the separator for this value. For non-list-like values or the
def separator
  nil
end

def to_a

Single Values are considered the same as single-element arrays.
Returns the value of this Value as an array.
def to_a
  [self]
end

def to_bool

Returns `true` (all Values are truthy)
def to_bool
  true
end

def to_h

Raises:
  • (SassC::SyntaxError) - if this value doesn't have a hash representation

Returns:
  • (Hash) - This value as a hash
def to_h
  raise SassC::SyntaxError.new("#{inspect} is not a map.")
end

def to_i

Raises SassC::SyntaxError if this value doesn’t implment integer conversion.
Returns the integer value of this value.
def to_i
  raise SassC::SyntaxError.new("#{inspect} is not an integer.")
end

def to_s(opts = {})

Returns:
  • (String) -
def to_s(opts = {})
  SassC::Util.abstract(self)
end

def with_contents(contents, separator: self.separator, bracketed: self.bracketed)

Returns:
  • (Sass::Script::Value::List) -

Parameters:
  • bracketed (Boolean) -- Whether the new list is bracketed. Defaults to \{#bracketed}.
  • separator (Symbol) -- The separator of the new list. Defaults to \{#separator}.
  • contents (Array) -- The contents of the new list.
def with_contents(contents, separator: self.separator, bracketed: self.bracketed)
  SassC::Script::Value::List.new(contents, separator: separator, bracketed: bracketed)
end