class FrontMatterParser::Loader::Yaml
{Loader} that uses YAML library
Attributes
@!attribute [r] allowlist_classes Classes that may be parsed by call.
Public Class Methods
Source
# File lib/front_matter_parser/loader/yaml.rb, line 13 def initialize(allowlist_classes: []) @allowlist_classes = allowlist_classes end
Public Instance Methods
Source
# File lib/front_matter_parser/loader/yaml.rb, line 21 def call(string) YAML.safe_load(string, permitted_classes: allowlist_classes) end
Loads a hash front matter from a string
@param string [String] front matter string representation @return [Hash] front matter hash representation