Sha256: 8a549fd77f34a4a020011b7b3fcd27a1dfef6334b506ba85d5120f1bb50a4590
Contents?: true
Size: 525 Bytes
Versions: 8
Compression:
Stored size: 525 Bytes
Contents
require 'microformat' class Microformat class Simple < String extend Microformat::Base def self.find_first(doc) find_every(doc).first end def self.find_occurences(doc) @from ? doc/from_as_xpath : super(doc) end def self.build_class(tag) new(tag.innerText) end def self.from(options) @from ||= [] options.each do |tag, value| @from << "@#{tag}=#{value}" end end def self.from_as_xpath "[#{@from.to_a * "|"}]" end end end
Version data entries
8 entries across 8 versions & 1 rubygems