class CssCompare::CSS::Value::ListLiteral

Wraps the SassScript ListLiteral object.

Public Instance Methods

==(other) click to toggle source

Checks, whether two list literals are equal.

@param [ListLiteral] other the other list literal @return [Boolean]

Calls superclass method CssCompare::CSS::Value::Base#==
# File lib/css_compare/css/value/list_literal.rb, line 11
def ==(other)
  return false unless super
  elements1 = @value.elements.length
  elements2 = other.value.elements.length
  return false unless elements1 == elements2
  @value.elements.each_index do |i|
    value1 = sanitize_string(@value.elements[i].to_sass)
    value2 = sanitize_string(other.value.elements[i].to_sass)
    return false unless value1 == value2
  end
  true
end