Class: SafeYAML::SafeToRubyVisitor

Inherits:
Psych::Visitors::ToRuby
  • Object
show all
Defined in:
lib/safe_yaml/safe_to_ruby_visitor.rb

Instance Method Summary collapse

Constructor Details

#initialize(resolver) ⇒ SafeToRubyVisitor

Returns a new instance of SafeToRubyVisitor.



3
4
5
6
# File 'lib/safe_yaml/safe_to_ruby_visitor.rb', line 3

def initialize(resolver)
  super()
  @resolver = resolver
end

Instance Method Details

#accept(node) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/safe_yaml/safe_to_ruby_visitor.rb', line 8

def accept(node)
  if node.tag
    SafeYAML.tag_safety_check!(node.tag, @resolver.options)
    return super
  end

  @resolver.resolve_node(node)
end