class Nokogiri::XML::SAX::ParserContext

def new(input, encoding = nil)


[Returns] Nokogiri::XML::SAX::ParserContext

otherwise it forwards to ParserContext.memory.
If +input+ quacks like a readable IO object, this method forwards to ParserContext.io,

encoding to use (default +nil+, encoding will be autodetected)
- +encoding+ (optional) (Encoding) The +Encoding+ to use, or the name of an
- +input+ (IO, String) A String or a readable IO object
[Parameters]

ParserContext.io and ParserContext.memory.
Create a parser context for an IO or a String. This is a shorthand method for

new(input, encoding)
new(input)
:call-seq:
##
def new(input, encoding = nil)
  if [:read, :close].all? { |x| input.respond_to?(x) }
    io(input, encoding)
  else
    memory(input, encoding)
  end
end