Sha256: 84eee776cf56d90c0ebf107683dfd18a195a3cbdf6ec38a670d992ecaa8399ab
Contents?: true
Size: 493 Bytes
Versions: 18
Compression:
Stored size: 493 Bytes
Contents
module Verku class Stream attr_accessor :listener, :content attr_reader :html def initialize(content, listener) @content = content @listener = listener @html = Nokogiri::HTML.parse(content) end def parse traverse(html) end def traverse(node) node.children.each do |child| emit(child) traverse(child) end end def emit(node) listener.send(:tag, node) if node.name =~ /h[1-6]/ end end end
Version data entries
18 entries across 18 versions & 1 rubygems