Class: Watir::Locators::Element::SelectorBuilder::RegexpDisassembler
- Inherits:
-
Object
- Object
- Watir::Locators::Element::SelectorBuilder::RegexpDisassembler
- Defined in:
- lib/watir/locators/element/selector_builder/regexp_disassembler.rb
Instance Method Summary collapse
-
#initialize(regexp) ⇒ RegexpDisassembler
constructor
A new instance of RegexpDisassembler.
- #substrings ⇒ Object
Constructor Details
#initialize(regexp) ⇒ RegexpDisassembler
Returns a new instance of RegexpDisassembler.
11 12 13 14 |
# File 'lib/watir/locators/element/selector_builder/regexp_disassembler.rb', line 11 def initialize(regexp) @regexp = regexp @regexp_source = regexp.source end |
Instance Method Details
#substrings ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/watir/locators/element/selector_builder/regexp_disassembler.rb', line 16 def substrings @substrings ||= begin strs = extract_strings(Regexp::Parser.parse(@regexp), [+'']) strs.map!(&:downcase) if @regexp.casefold? strs.reject(&:empty?).uniq end end |