Class: REXML::CSSSelector::Queries::IdQuery

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

Instance Method Summary collapse

Constructor Details

#initialize(cont:, name:) ⇒ IdQuery

Returns a new instance of IdQuery.



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

def initialize(cont:, name:)
  @cont = cont
  @name = name
end

Instance Method Details

#call(node, context) ⇒ Object



12
13
14
# File 'lib/rexml/css_selector/queries/id_query.rb', line 12

def call(node, context)
  context.adapter.get_id(node) == @name && @cont.call(node, context)
end