class Bridgetown::YAMLParser

Constants

PERMITTED_CLASSES

Public Class Methods

load(yaml) click to toggle source
# File lib/bridgetown-core/yaml_parser.rb, line 13
def load(yaml)
  if RUBY_VERSION.start_with?("2.5")
    YAML.safe_load yaml, PERMITTED_CLASSES
  else
    YAML.safe_load yaml, permitted_classes: PERMITTED_CLASSES
  end
end
load_file(filename, **kwargs) click to toggle source
# File lib/bridgetown-core/yaml_parser.rb, line 8
def load_file(filename, **kwargs)
  kwargs = { permitted_classes: PERMITTED_CLASSES }.merge(kwargs)
  YAML.safe_load_file(filename, **kwargs)
end