Class: FrontMatterParser::Parsed
- Inherits:
-
Object
- Object
- FrontMatterParser::Parsed
- Defined in:
- lib/front_matter_parser/parsed.rb
Overview
Result of parsing front matter and content from a string
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#[](key) ⇒ String, ...
Returns front matter value for given key.
-
#initialize(front_matter:, content:) ⇒ Parsed
constructor
A new instance of Parsed.
Constructor Details
#initialize(front_matter:, content:) ⇒ Parsed
Returns a new instance of Parsed.
16 17 18 19 |
# File 'lib/front_matter_parser/parsed.rb', line 16 def initialize(front_matter:, content:) @front_matter = front_matter @content = content end |
Instance Attribute Details
#content ⇒ Object
12 13 14 |
# File 'lib/front_matter_parser/parsed.rb', line 12 def content @content end |
#front_matter ⇒ Object
8 9 10 |
# File 'lib/front_matter_parser/parsed.rb', line 8 def front_matter @front_matter end |
Instance Method Details
#[](key) ⇒ String, ...
Returns front matter value for given key
25 26 27 |
# File 'lib/front_matter_parser/parsed.rb', line 25 def [](key) front_matter[key] end |