class Sass::Script::Value::Map

values can be any SassScript object.
A SassScript object representing a map from keys to values. Both keys and

def eq(other)

Other tags:
    See: Value#eq -
def eq(other)
  Bool.new(other.is_a?(Map) && value == other.value)
end

def hash

def hash
  @hash ||= value.hash
end

def initialize(hash)

Parameters:
  • hash (Hash) --
def initialize(hash)
  super(hash)
end

def options=(options)

Other tags:
    See: Value#options= -
def options=(options)
  super
  value.each do |k, v|
    k.options = options
    v.options = options
  end
end

def separator

Other tags:
    See: Value#separator -
def separator
  :comma unless value.empty?
end

def to_a

Other tags:
    See: Value#to_a -
def to_a
  value.map do |k, v|
    list = List.new([k, v], separator: :space)
    list.options = options
    list
  end
end

def to_s(opts = {})

Other tags:
    See: Value#to_s -
def to_s(opts = {})
  raise Sass::SyntaxError.new("#{inspect} isn't a valid CSS value.")
end

def to_sass(opts = {})

def to_sass(opts = {})
  return "()" if value.empty?
  to_sass = lambda do |value|
    if value.is_a?(List) && value.separator == :comma
      "(#{value.to_sass(opts)})"
    else
      value.to_sass(opts)
    end
  end
  "(#{value.map {|(k, v)| "#{to_sass[k]}: #{to_sass[v]}"}.join(', ')})"
end