class Motion::HTML::Doc
Public Class Methods
new(html)
click to toggle source
# File lib/project/motion-html.rb, line 8 def initialize(html) @doc = HTMLDocument.documentWithString(html) end
Public Instance Methods
all(q)
click to toggle source
# File lib/project/motion-html.rb, line 12 def all(q) nodes = @doc.querySelectorAll(q) nodes.map {|node| Element.new(node) } end
first(q)
click to toggle source
# File lib/project/motion-html.rb, line 17 def first(q) all(q).first end
Also aliased as: find