Exception: CSSNative::SelectorError
- Defined in:
- lib/css-native/errors.rb
Instance Method Summary collapse
-
#initialize(msg = "Selector not valid", element: nil, previous: nil) ⇒ SelectorError
constructor
A new instance of SelectorError.
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 |