Class: Capybara::Selector::Filters::LocatorFilter
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
NodeFilter ,
Base
|
|
Instance Chain:
self,
NodeFilter ,
Base
|
|
Inherits: |
Capybara::Selector::Filters::NodeFilter
|
Defined in: | lib/capybara/selector/filters/locator_filter.rb |
Class Method Summary
Instance Attribute Summary
Instance Method Summary
- #matches?(node, value, context = nil, exact:) ⇒ Boolean
- #apply(subject, value, skip_value, ctx, **options) private
NodeFilter
- Inherited
Base
- Inherited
Constructor Details
.new(block, **options) ⇒ LocatorFilter
# File 'lib/capybara/selector/filters/locator_filter.rb', line 9
def initialize(block, ** ) super(nil, nil, block, ** ) end
Instance Method Details
#apply(subject, value, skip_value, ctx, **options) (private)
[ GitHub ]# File 'lib/capybara/selector/filters/locator_filter.rb', line 21
def apply(subject, value, skip_value, ctx, ** ) return skip_value if skip?(value) filter_context(ctx).instance_exec(subject, value, **, &@block) end
#matches?(node, value, context = nil, exact:) ⇒ Boolean
# File 'lib/capybara/selector/filters/locator_filter.rb', line 13
def matches?(node, value, context = nil, exact:) apply(node, value, true, context, exact: exact, format: context&.default_format) rescue Capybara::ElementNotFound false end