D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
td-agent
/
embedded
/
lib
/
ruby
/
gems
/
2.1.0
/
doc
/
nokogiri-1.8.1
/
ri
/
Nokogiri
/
XML
/
Searchable
/
Filename :
css-i.ri
back
Copy
U:RDoc::AnyMethod[iI"css:EFI""Nokogiri::XML::Searchable#css;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"ISearch this object for CSS +rules+. +rules+ must be one or more CSS ;TI"selectors. For example:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"node.css('title') ;TI"node.css('body h1.bold') ;TI"*node.css('div + p.green', 'div#one') ;T:@format0o; ; [I"?A hash of namespace bindings may be appended. For example:;T@o;; [I">node.css('bike|tire', {'bike' => 'http://schwinn.com/'}) ;T; 0o; ; [ I"?Custom CSS pseudo classes may also be defined. To define ;TI"Dcustom pseudo classes, create a class and implement the custom ;TI"?pseudo class you want defined. The first argument to the ;TI"=method will be the current matching NodeSet. Any other ;TI"7arguments are ones that you pass in. For example:;T@o;; [ I"0node.css('title:regex("\w+")', Class.new { ;TI"! def regex node_set, regex ;TI"K node_set.find_all { |node| node['some_attribute'] =~ /#{regex}/ } ;TI" end ;TI"}.new) ;T; 0o; ; [I"CNote that the CSS query string is case-sensitive with regards ;TI"Cto your document type. That is, if you're looking for "H1" in ;TI"Can HTML document, you'll never find anything, since HTML tags ;TI"Cwill match only lowercase CSS queries. However, "H1" might be ;TI"Cfound in an XML document, where tags names are case-sensitive ;TI"((e.g., "H1" is distinct from "h1").;T: @fileI"#lib/nokogiri/xml/searchable.rb;T:0@omit_headings_from_table_of_contents_below0I";css *rules, [namespace-bindings, custom-pseudo-class] ;T0[ I"(*args);T@1FI"Searchable;FcRDoc::NormalModule00