Class: YAMLRewriter::MarkHandler

Inherits:
Psych::TreeBuilder
  • Object
show all
Defined in:
lib/yaml_rewriter/mark_handler.rb

Instance Method Summary collapse

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