Class: RuboCop::Cop::Utils::RegexpRanges
- Inherits:
-
Object
- Object
- RuboCop::Cop::Utils::RegexpRanges
- Defined in:
- lib/rubocop/cop/utils/regexp_ranges.rb
Overview
Helper to abstract complexity of building range pairs with octal escape reconstruction (needed for regexp_parser < 2.7).
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #compound_token ⇒ Object
-
#initialize(root) ⇒ RegexpRanges
constructor
A new instance of RegexpRanges.
- #pairs ⇒ Object
Constructor Details
#initialize(root) ⇒ RegexpRanges
Returns a new instance of RegexpRanges.
11 12 13 14 15 16 |
# File 'lib/rubocop/cop/utils/regexp_ranges.rb', line 11 def initialize(root) @root = root @compound_token = [] @pairs = [] @populated = false end |
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
9 10 11 |
# File 'lib/rubocop/cop/utils/regexp_ranges.rb', line 9 def root @root end |
Instance Method Details
#compound_token ⇒ Object
18 19 20 21 22 |
# File 'lib/rubocop/cop/utils/regexp_ranges.rb', line 18 def compound_token populate_all unless @populated @compound_token end |
#pairs ⇒ Object
24 25 26 27 28 |
# File 'lib/rubocop/cop/utils/regexp_ranges.rb', line 24 def pairs populate_all unless @populated @pairs end |