Class: CssCompare::CSS::Value::ListLiteral
- Defined in:
- lib/css_compare/css/value/list_literal.rb
Overview
Wraps the SassScript ListLiteral object.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Checks, whether two list literals are equal.
Methods inherited from Base
#color?, #equals?, #important?, #initialize, #to_s
Constructor Details
This class inherits a constructor from CssCompare::CSS::Value::Base
Instance Method Details
#==(other) ⇒ Boolean
Checks, whether two list literals are equal.
11 12 13 14 15 16 17 18 19 20 21 22 |
# 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 |