Sha256: a171b8da748eafe8d98d8b25f38925fa611b3e43166e6840d1136a921016a8a5
Contents?: true
Size: 519 Bytes
Versions: 10
Compression:
Stored size: 519 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.text) 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
10 entries across 10 versions & 2 rubygems