module Gem::YAMLSerializer - Documentation for Ruby 4.1
Description: Documentation for the Gem::YAMLSerializer module
Keywords: ruby,module,Gem::YAMLSerializer

🔍

No recent searches

# module Gem::YAMLSerializer

### Constants

AliasRef
Mapping
Scalar
Sequence

### Public Instance Methods

dump (obj)
Source

    # File lib/rubygems/yaml_serializer.rb, line 798
    def dump(obj)
      Emitter.new.emit(obj)
    end

load (str, permitted_classes: [], permitted_symbols: [], aliases: true)
Source

    # File lib/rubygems/yaml_serializer.rb, line 802
    def load(str, permitted_classes: [], permitted_symbols: [], aliases: true)
      raise TypeError, "no implicit conversion of nil into String" if str.nil?
      return nil if str.empty?

      ast = Parser.new(str).parse
      return nil if ast.nil?

      Builder.new(
        permitted_classes: permitted_classes,
        permitted_symbols: permitted_symbols,
        aliases: aliases
      ).build(ast)
    end