Class: REXML::CSSSelector::Queries::RootQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/rexml/css_selector/queries/root_query.rb

Instance Method Summary collapse

Constructor Details

#initialize(cont:) ⇒ RootQuery

Returns a new instance of RootQuery.



7
8
9
# File 'lib/rexml/css_selector/queries/root_query.rb', line 7

def initialize(cont:)
  @cont = cont
end

Instance Method Details

#call(node, context) ⇒ Object



11
12
13
# File 'lib/rexml/css_selector/queries/root_query.rb', line 11

def call(node, context)
  context.adapter.element?(node) && context.adapter.root?(node) && @cont.call(node, context)
end