Module: Rusty::Selector

Defined in:
lib/rusty/selector.rb

Overview

A selector is an object which is created based on a selector string, and which implements the ‘weight` and `match?` methods.

Defined Under Namespace

Classes: CSS, CachedCSS

Constant Summary collapse

DEFAULT_SELECTOR =

You probably want cached selectors, especially when working with larger documents. If these eat to much memory, try to use

DEFAULT_SELECTOR = Rusty::Selector::CSS

but expect exploding runtimes: this increases O(m+n) -> O(m*n).

Rusty::Selector::CachedCSS

Class Method Summary collapse

Class Method Details

.new(selector) ⇒ Object

Create a Selector object for a given ‘selector` string.



84
85
86
# File 'lib/rusty/selector.rb', line 84

def self.new(selector)
  DEFAULT_SELECTOR.new selector
end