class Sass::Value::Map

def ==(other)

Returns:
  • (::Boolean) -
def ==(other)
  (other.is_a?(Sass::Value::Map) && other.contents == contents) ||
    (contents.empty? && other.is_a?(Sass::Value::List) && other.to_a.empty?)
end

def assert_map(_name = nil)

Returns:
  • (Map) -
def assert_map(_name = nil)
  self
end

def at(index)

Returns:
  • (List<(Value, Value)>, Value) -

Parameters:
  • index (Numeric, Value) --
def at(index)
  if index.is_a?(Numeric)
    index = index.floor
    index = to_a_length + index if index.negative?
    return nil if index.negative? || index >= to_a_length
    Sass::Value::List.new(contents.to_a[index], separator: ' ')
  else
    contents[index]
  end
end

def hash

Returns:
  • (Integer) -
def hash
  @hash ||= contents.hash
end

def initialize(contents = {})

Parameters:
  • contents (Hash) --
def initialize(contents = {})
  @contents = contents.freeze
end

def separator

Returns:
  • (::String, nil) -
def separator
  contents.empty? ? nil : ','
end

def to_a

Returns:
  • (Array>) -
def to_a
  contents.map { |key, value| Sass::Value::List.new([key, value], separator: ' ') }
end

def to_a_length

def to_a_length
  contents.length
end

def to_map

Returns:
  • (Map) -
def to_map
  self
end