module Gem::SafeYAML - Documentation for Ruby 4.1
Description: module Gem::SafeYAML: This module is used for safely loading YAML specs from a gem. The `safe_load` method defined on this module is specifically designed for loading Gem s
Keywords: ruby,module,Gem::SafeYAML

🔍

No recent searches

# module Gem::SafeYAML

This module is used for safely loading `YAML` specs from a gem. The `safe_load` method defined on this module is specifically designed for loading `Gem` specifications. For loading other `YAML` safely, please see `Psych.safe_load`

### Constants

PERMITTED_CLASSES
PERMITTED_SYMBOLS

### Public Class Methods

load (input)
Alias for: safe_load
safe_load (input)
Source

    # File lib/rubygems/safe_yaml.rb, line 37
    def self.safe_load(input)
      if Gem.use_psych?
        ::Psych.safe_load(input, permitted_classes: PERMITTED_CLASSES,
                                 permitted_symbols: PERMITTED_SYMBOLS, aliases: @aliases_enabled)
      else
        Gem::YAMLSerializer.load(
          input,
          permitted_classes: PERMITTED_CLASSES,
          permitted_symbols: PERMITTED_SYMBOLS,
          aliases: aliases_enabled?
        )
      end
    end

Also aliased as: load