Class: Filepress::FileParser

Inherits:
Object
  • Object
show all
Defined in:
lib/filepress/file_parser.rb

Constant Summary collapse

FRONTMATTER_PATTERN =
/\A---\s*\n(.*?\n?)---\s*\n?(.*)\z/m

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject (readonly)

Returns the value of attribute attributes.



7
8
9
# File 'lib/filepress/file_parser.rb', line 7

def attributes
  @attributes
end

#bodyObject (readonly)

Returns the value of attribute body.



7
8
9
# File 'lib/filepress/file_parser.rb', line 7

def body
  @body
end