Class: Psych::Merge::CommentTracker
- Inherits:
-
Ast::Merge::Comment::HashTrackerBase
- Object
- Ast::Merge::Comment::HashTrackerBase
- Psych::Merge::CommentTracker
- Defined in:
- lib/psych/merge/comment_tracker.rb
Overview
Extracts and tracks comments with their line numbers from YAML source. YAML comments use the same # syntax as Ruby, making freeze block detection straightforward.
Inherits shared lookup, query, region-building, and attachment API from
Ast::Merge::Comment::HashTrackerBase. Only format-specific comment
extraction and owner resolution are overridden here.
Instance Method Summary collapse
-
#initialize(source) ⇒ CommentTracker
constructor
Initialize comment tracker by scanning the source.
Constructor Details
#initialize(source) ⇒ CommentTracker
Initialize comment tracker by scanning the source
25 26 27 28 29 |
# File 'lib/psych/merge/comment_tracker.rb', line 25 def initialize(source) @source = source @line_parser = Ast::Merge::Comment::QuotedHashLineParser.new super(source.lines.map(&:chomp)) end |