Class: REXML::CSSSelector::Queries::ChildQuery
- Inherits:
-
Object
- Object
- REXML::CSSSelector::Queries::ChildQuery
- Defined in:
- lib/rexml/css_selector/queries/child_query.rb
Instance Method Summary collapse
- #call(node, context) ⇒ Object
-
#initialize(cont:) ⇒ ChildQuery
constructor
A new instance of ChildQuery.
Constructor Details
#initialize(cont:) ⇒ ChildQuery
Returns a new instance of ChildQuery.
7 8 9 |
# File 'lib/rexml/css_selector/queries/child_query.rb', line 7 def initialize(cont:) @cont = cont end |
Instance Method Details
#call(node, context) ⇒ Object
11 12 13 14 |
# File 'lib/rexml/css_selector/queries/child_query.rb', line 11 def call(node, context) node = context.adapter.get_parent_node(node) context.adapter.element?(node) && @cont.call(node, context) end |