Class: YamlLint::Linter::KeyOverlapDetector
- Inherits:
-
Object
- Object
- YamlLint::Linter::KeyOverlapDetector
- Defined in:
- lib/yamllint/linter.rb
Overview
Detects duplicate keys in Psych parsed data
Instance Attribute Summary collapse
-
#overlapping_keys ⇒ Object
readonly
Returns the value of attribute overlapping_keys.
Instance Method Summary collapse
-
#initialize ⇒ KeyOverlapDetector
constructor
Setup class variables.
-
#parse(psych_parse_data) ⇒ Object
Get the data and send it off for duplicate key validation.
Constructor Details
#initialize ⇒ KeyOverlapDetector
Setup class variables
133 134 135 136 137 138 139 140 |
# File 'lib/yamllint/linter.rb', line 133 def initialize @seen_keys = Set.new @key_components = [] @last_key = [''] @overlapping_keys = Set.new @complex_type = [] @array_positions = [] end |
Instance Attribute Details
#overlapping_keys ⇒ Object (readonly)
Returns the value of attribute overlapping_keys.
130 131 132 |
# File 'lib/yamllint/linter.rb', line 130 def overlapping_keys @overlapping_keys end |
Instance Method Details
#parse(psych_parse_data) ⇒ Object
Get the data and send it off for duplicate key validation
143 144 145 146 |
# File 'lib/yamllint/linter.rb', line 143 def parse(psych_parse_data) data_start = psych_parse_data.handler.root.children[0] parse_recurse(data_start) end |