Class: Filepress::FileParser
- Inherits:
-
Object
- Object
- Filepress::FileParser
- Defined in:
- lib/filepress/file_parser.rb
Constant Summary collapse
- FRONTMATTER_PATTERN =
/\A---\s*\n(.*?\n?)---\s*\n?(.*)\z/m
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Instance Method Summary collapse
-
#initialize(raw_content) ⇒ FileParser
constructor
A new instance of FileParser.
Constructor Details
#initialize(raw_content) ⇒ FileParser
Returns a new instance of FileParser.
9 10 11 |
# File 'lib/filepress/file_parser.rb', line 9 def initialize(raw_content) @attributes, @body = parse(raw_content) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
7 8 9 |
# File 'lib/filepress/file_parser.rb', line 7 def attributes @attributes end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/filepress/file_parser.rb', line 7 def body @body end |