class FrontMatterParser::Parsed

Result of parsing front matter and content from a string

Attributes

content[R]

@!attribute [rw] content @see initialize

front_matter[R]

@!attribute [rw] front_matter @see initialize

Public Class Methods

new(front_matter:, content:) click to toggle source

@param front_matter [Hash] parsed front_matter @param content [String] parsed content

# File lib/front_matter_parser/parsed.rb, line 16
def initialize(front_matter:, content:)
  @front_matter = front_matter
  @content = content
end

Public Instance Methods

[](key) click to toggle source

Returns front matter value for given key

@param key [String] key for desired value @return [String, Array, # Hash] desired value

# File lib/front_matter_parser/parsed.rb, line 25
def [](key)
  front_matter[key]
end