Class: StyleCop::SelectorDifference

Inherits:
Object
  • Object
show all
Defined in:
lib/style_cop/selector_difference.rb

Constant Summary collapse

MISSING_CSS_TEXT =
"element is missing the following css"
EXTRA_CSS_TEXT =
"element has the following extra css"
MISSING_STRUCTURE_TEXT =
"element is missing the following structure piece"
EXTRA_STRUCTURE_TEXT =
"element has the following extra structure piece"

Instance Method Summary collapse

Constructor Details

#initialize(selector, other_selector) ⇒ SelectorDifference

Returns a new instance of SelectorDifference.



8
9
10
11
# File 'lib/style_cop/selector_difference.rb', line 8

def initialize(selector, other_selector)
  @selector = selector
  @other_selector = other_selector
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/style_cop/selector_difference.rb', line 13

def empty?
  selector.representation == other_selector.representation
end

#error_messageObject



17
18
19
# File 'lib/style_cop/selector_difference.rb', line 17

def error_message
  (css_errors + structure_errors).join(", ")
end