Class: Nokogiri::HTML::SAX::PushParser

Inherits:
NokogiriXmlSaxPushParser
  • Object
show all
Defined in:
lib/nokogiri/html/sax/push_parser.rb,
ext/nokogiri/html_sax_push_parser.c

Instance Method Summary collapse

Constructor Details

#initialize(doc = XML::SAX::Document.new, file_name = nil, encoding = 'UTF-8') ⇒ PushParser

Returns a new instance of PushParser.



5
6
7
8
9
10
11
12
# File 'lib/nokogiri/html/sax/push_parser.rb', line 5

def initialize(doc = XML::SAX::Document.new, file_name = nil, encoding = 'UTF-8')
  @document = doc
  @encoding = encoding
  @sax_parser = HTML::SAX::Parser.new(doc, @encoding)

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