Method: Document::Document#initialize

Defined in:
lib/document/document.rb

#initialize(path, content) ⇒ Document

Returns a new instance of Document.



13
14
15
16
17
18
19
20
21
# File 'lib/document/document.rb', line 13

def initialize(path, content)
  
  path = File.basename(path).gsub(FILE_ENDINGS, '')
  
  # please do not confuse Filepath of Document (like docs/README.md) with path in Dom
  # an .md will be stripped from the name and README.SOMEMORE.md can be used as path information
  @path, @name, @content = ".#{path}", extract_name_from(path), content
  super()
end