Sha256: efc0e40b07ca845fa815c6c722c5ac4d30db68702c1f52938751e0b6dfc357f6
Contents?: true
Size: 685 Bytes
Versions: 19
Compression:
Stored size: 685 Bytes
Contents
require 'hpricot' module Hpricot::IMWExtensions # Return the contents of the first element to match +path+. def contents_of path cnts = self.at path cnts.inner_html if cnts end # Return the value of +attr+ for the first element to match +path+. def path_attr path, attr cnts = self.at path cnts.attributes[attr] if cnts end # Return the value of the +class+ attribute of the first element to # match +path+. def class_of path self.path_attr(path, 'class') end end class Hpricot::Elem include Hpricot::IMWExtensions end class Hpricot::Elements include Hpricot::IMWExtensions end class Hpricot::Doc include Hpricot::IMWExtensions end
Version data entries
19 entries across 19 versions & 1 rubygems