Sha256: a9152fb1310aefe2c0af967b2e1bb0dbb97820bd6a38197f04bb07d08401ffad

Contents?: true

Size: 406 Bytes

Versions: 2

Compression:

Stored size: 406 Bytes

Contents

# frozen_string_literal: true

require 'yaml'

module FrontMatterParser
  module Loader
    # {Loader} that uses YAML library
    class Yaml
      # Loads a hash front matter from a string
      #
      # @param string [String] front matter string representation
      # @return [Hash] front matter hash representation
      def self.call(string)
        YAML.safe_load(string)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
front_matter_parser-0.1.1 lib/front_matter_parser/loader/yaml.rb
front_matter_parser-0.1.0 lib/front_matter_parser/loader/yaml.rb