Exception: CSSNative::SelectorError

Inherits:
RuleError show all
Defined in:
lib/css-native/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(msg = "Selector not valid", element: nil, previous: nil) ⇒ SelectorError

Returns a new instance of SelectorError.



35
36
37
38
39
40
41
42
43
# File 'lib/css-native/errors.rb', line 35

def initialize(msg = "Selector not valid", element: nil, previous: nil)
  if element.nil? && previous.nil?
    super(msg)
  elsif previous.nil?
    super("Selector '#{element}' not valid")
  else
    super("Selector '#{element}' not valid after '#{previous}' selector part")
  end
end