Class: Capybara::Selector::RegexpDisassembler Private
- Inherits:
-
Object
- Object
- Capybara::Selector::RegexpDisassembler
- Defined in:
- lib/capybara/selector/regexp_disassembler.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #alternated_substrings ⇒ Object private
-
#initialize(regexp) ⇒ RegexpDisassembler
constructor
private
A new instance of RegexpDisassembler.
- #substrings ⇒ Object private
Constructor Details
#initialize(regexp) ⇒ RegexpDisassembler
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of RegexpDisassembler.
9 10 11 |
# File 'lib/capybara/selector/regexp_disassembler.rb', line 9 def initialize(regexp) @regexp = regexp end |
Instance Method Details
#alternated_substrings ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 16 17 18 19 |
# File 'lib/capybara/selector/regexp_disassembler.rb', line 13 def alternated_substrings @alternated_substrings ||= begin or_strings = process(alternation: true) remove_or_covered(or_strings) or_strings.any?(&:empty?) ? [] : or_strings end end |
#substrings ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 24 25 26 |
# File 'lib/capybara/selector/regexp_disassembler.rb', line 21 def substrings @substrings ||= begin strs = process(alternation: false).first remove_and_covered(strs) end end |