Class: REXML::CSSSelector::Queries::AttributePresenceQuery

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

Instance Method Summary collapse

Constructor Details

#initialize(cont:, name:, namespace:) ⇒ AttributePresenceQuery

Returns a new instance of AttributePresenceQuery.



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

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

Instance Method Details

#call(node, context) ⇒ Object



13
14
15
16
# File 'lib/rexml/css_selector/queries/attribute_presence_query.rb', line 13

def call(node, context)
  context.adapter.get_attribute(node, @name, @namespace, context.options[:attribute_name_case]) &&
    @cont.call(node, context)
end