Method: Vines::Stream#create_parser

Defined in:
lib/vines/stream.rb

#create_parserObject

Initialize a new XML parser for this connection. This is called when the stream is first connected as well as for stream restarts during negotiation. Subclasses can override this method to provide a different type of parser (e.g. HTTP).



36
37
38
39
40
41
42
# File 'lib/vines/stream.rb', line 36

def create_parser
  @parser = Parser.new.tap do |p|
    p.stream_open {|node| @nodes.push(node) }
    p.stream_close { close_connection }
    p.stanza {|node| @nodes.push(node) }
  end
end