Method: Brief::Document#initialize
- Defined in:
- lib/brief/document.rb
#initialize(path, options = {}) ⇒ Document
Returns a new instance of Document.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/brief/document.rb', line 14 def initialize(path, = {}) if path.respond_to?(:key?) && .empty? @frontmatter = path.to_mash else @path = Pathname(path) end = .to_mash if @path && self.path.exist? @raw_content = self.path.read load_frontmatter elsif [:contents] @raw_content = [:contents] end end |