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
-
#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
#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 substrings @substrings ||= begin strs = extract_strings(Regexp::Parser.parse(@regexp), [+'']) strs.map!(&:upcase) if @regexp.casefold? strs.reject(&:empty?).uniq end end |