Class: YAMLRewriter::MarkHandler
- Inherits:
-
Psych::TreeBuilder
- Object
- Psych::TreeBuilder
- YAMLRewriter::MarkHandler
- Defined in:
- lib/yaml_rewriter/mark_handler.rb
Instance Method Summary collapse
-
#initialize(parser) ⇒ MarkHandler
constructor
A new instance of MarkHandler.
- #scalar(value, anchor, tag, plain, quoted, style) ⇒ Object
Constructor Details
#initialize(parser) ⇒ MarkHandler
Returns a new instance of MarkHandler.
5 6 7 8 |
# File 'lib/yaml_rewriter/mark_handler.rb', line 5 def initialize(parser) @parser = parser super() end |
Instance Method Details
#scalar(value, anchor, tag, plain, quoted, style) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/yaml_rewriter/mark_handler.rb', line 10 def scalar(value, anchor, tag, plain, quoted, style) mark = @parser.mark super.tap do |scalar| scalar.mark = mark end end |