Class: Capybara::Selector::RegexpDisassembler Private

Inherits:
Object
  • Object
show all
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

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_substringsObject

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

#substringsObject

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