nokogiri / 1.13.0 / nokogiri / html4 / sax / pushparser.html /

class Nokogiri::HTML4::SAX::PushParser

Parent:
Object

💡 This class is an alias for Nokogiri::HTML4::SAX::PushParser as of v1.12.0.

Attributes

document [RW]

The Nokogiri::HTML4::SAX::Document on which the PushParser will be operating

Public Class Methods

new (doc = HTML4::SAX::Document.new, file_name = nil, encoding = "UTF-8") Show source
# File lib/nokogiri/html4/sax/push_parser.rb, line 11
def initialize(doc = HTML4::SAX::Document.new, file_name = nil, encoding = "UTF-8")
  @document = doc
  @encoding = encoding
  @sax_parser = HTML4::SAX::Parser.new(doc, @encoding)

  ## Create our push parser context
  initialize_native(@sax_parser, file_name, encoding)
end

Public Instance Methods

<< (chunk, last_chunk = false)
Alias for: write
finish () Show source
# File lib/nokogiri/html4/sax/push_parser.rb, line 31
def finish
  write("", true)
end

Finish the parsing. This method is only necessary for Nokogiri::HTML4::SAX::Document#end_document to be called.

write (chunk, last_chunk = false) Show source
# File lib/nokogiri/html4/sax/push_parser.rb, line 23
def write(chunk, last_chunk = false)
  native_write(chunk, last_chunk)
end

Write a chunk of HTML to the PushParser. Any callback methods that can be called will be called immediately.

Also aliased as: <<

© 2008–2018 Aaron Patterson, Mike Dalessio, Charles Nutter, Sergio Arbeo,
Patrick Mahoney, Yoko Harada, Akinori MUSHA, John Shahid, Lars Kanis
Licensed under the MIT License.
https://nokogiri.org/rdoc/Nokogiri/HTML4/SAX/PushParser.html