Method: Nokogiri::CSS::XPathVisitor#initialize

Defined in:
lib/nokogiri/css/xpath_visitor.rb

#initialize(builtins: BuiltinsConfig::NEVER, doctype: DoctypeConfig::XML) ⇒ XPathVisitor

:call-seq:

new() → XPathVisitor
new(builtins:, doctype:) → XPathVisitor
Parameters
  • builtins: (BuiltinsConfig) Determine when to use Nokogiri’s built-in xpath functions for performance improvements.

  • doctype: (DoctypeConfig) Make document-type-specific accommodations for CSS queries.

Returns

XPathVisitor



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/nokogiri/css/xpath_visitor.rb', line 57

def initialize(builtins: BuiltinsConfig::NEVER, doctype: DoctypeConfig::XML)
  unless BuiltinsConfig::VALUES.include?(builtins)
    raise(ArgumentError, "Invalid values #{builtins.inspect} for builtins: keyword parameter")
  end
  unless DoctypeConfig::VALUES.include?(doctype)
    raise(ArgumentError, "Invalid values #{doctype.inspect} for doctype: keyword parameter")
  end

  @builtins = builtins
  @doctype = doctype
end