Class: Hexp::CssSelector::SimpleSequence

Inherits:
Object
  • Object
show all
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

#members

Instance Method Summary collapse

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

Returns:

  • (true, false)


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

Returns:

  • (Boolean)


171
172
173
# File 'lib/hexp/css_selector.rb', line 171

def matches_path?(path)
  matches?(path.last)
end