Method: Nokogiri.Slop

Defined in:
lib/nokogiri.rb

.Slop(*args, &block) ⇒ Object

Parse a document and add the Slop decorator. The Slop decorator implements method_missing such that methods may be used instead of CSS or XPath. For example:

doc = Nokogiri::Slop(<<-eohtml)
  <html>
    <body>
      <p>first</p>
      <p>second</p>
    </body>
  </html>
eohtml
assert_equal('second', doc.html.body.p[1].text)


91
92
93
# File 'lib/nokogiri.rb', line 91

def Slop(*args, &block)
  Nokogiri(*args, &block).slop!
end