Class: SafeYAML::SafeToRubyVisitor

### Home Classes Methods

### In Files

- lib/safe_yaml/safe_to_ruby_visitor.rb

### Parent

Psych::Visitors::ToRuby

### Methods

- ::new
- #accept

### Class/Module Index

Quicksearch

- SafeYAML
- SafeYAML::Deep
- SafeYAML::LibyamlChecker
- SafeYAML::Parse
- SafeYAML::Parse::Date
- SafeYAML::Parse::Hexadecimal
- SafeYAML::Parse::Sexagesimal
- SafeYAML::PsychHandler
- SafeYAML::PsychResolver
- SafeYAML::Resolver
- SafeYAML::SafeToRubyVisitor
- SafeYAML::SyckResolver
- SafeYAML::Transform
- SafeYAML::Transform::ToBoolean
- SafeYAML::Transform::ToDate
- SafeYAML::Transform::ToFloat
- SafeYAML::Transform::ToInteger
- SafeYAML::Transform::ToNil
- SafeYAML::Transform::ToSymbol
- SafeYAML::Transform::TransformationMap
- SafeYAML::Transform::TransformationMap::CaseAgnosticMap
- SafeYAML::Transform::TransformationMap::ClassMethods
- Object
- YAML

No matching classes.

# SafeYAML::SafeToRubyVisitor

### Constants

INITIALIZE_ARITY

### Public Class Methods

new(resolver) click to toggle source

    # File lib/safe_yaml/safe_to_ruby_visitor.rb, line 5
    def initialize(resolver)
      case INITIALIZE_ARITY
      when 2
        # https://github.com/tenderlove/psych/blob/v2.0.0/lib/psych/visitors/to_ruby.rb#L14-L28
        loader  = Psych::ClassLoader.new
        scanner = Psych::ScalarScanner.new(loader)
        super(scanner, loader)

      else
        super()
      end

      @resolver = resolver
    end

### Public Instance Methods

accept(node) click to toggle source

    # File lib/safe_yaml/safe_to_ruby_visitor.rb, line 20
    def accept(node)
      if node.tag
        SafeYAML.tag_safety_check!(node.tag, @resolver.options)
        return super
      end

      @resolver.resolve_node(node)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.