class Sass::Value::Map
@see sass-lang.com/documentation/js-api/classes/sassmap/
Sass’s map type.
def ==(other)
-
(::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)
-
(Map)
-
def assert_map(_name = nil) self end
def at(index)
-
(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
-
(Integer)
-
def hash @hash ||= contents.hash end
def initialize(contents = {})
-
contents
(Hash
) --
def initialize(contents = {}) @contents = contents.freeze end
def separator
-
(::String, nil)
-
def separator contents.empty? ? nil : ',' end
def to_a
-
(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
-
(Map)
-
def to_map self end