Method: Brief::Document#initialize
- Defined in:
- lib/brief/document.rb
#initialize(path, options = {}) ⇒ Document
Returns a new instance of Document.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/brief/document.rb', line 25 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 |