Class: Hexp::CssSelector::SimpleSequence
- Inherits:
-
Object
- Object
- Hexp::CssSelector::SimpleSequence
- Includes:
- Members
- Defined in:
- lib/hexp/css_selector.rb
Overview
A CSS sequence that relates to a single element, like ‘div.caption:first’
Instance Attribute Summary
Attributes included from Members
Instance Method Summary collapse
-
#matches?(element) ⇒ true, false
(also: #head_matches?)
private
Does the element match all parts of this SimpleSequence.
- #matches_path?(path) ⇒ Boolean
Methods included from Members
included, #initialize, #inspect
Instance Method Details
#matches?(element) ⇒ true, false Also known as: head_matches?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Does the element match all parts of this SimpleSequence
182 183 184 185 186 |
# File 'lib/hexp/css_selector.rb', line 182 def matches?(element) members.all? do |simple| simple.matches?(element) end end |
#matches_path?(path) ⇒ Boolean
171 172 173 |
# File 'lib/hexp/css_selector.rb', line 171 def matches_path?(path) matches?(path.last) end |