Class: Autodoc::Documents

Inherits:
Object
  • Object
show all
Defined in:
lib/autodoc/documents.rb

Instance Method Summary collapse

Constructor Details

#initializeDocuments

Returns a new instance of Documents.



5
6
7
# File 'lib/autodoc/documents.rb', line 5

def initialize
  @table = Hash.new {|table, key| table[key] = [] }
end

Instance Method Details

#append(context, example) ⇒ Object



9
10
11
12
# File 'lib/autodoc/documents.rb', line 9

def append(context, example)
  document = Autodoc::Document.new(context.clone, example.clone)
  @table[document.pathname] << document
end

#writeObject



14
15
16
17
# File 'lib/autodoc/documents.rb', line 14

def write
  write_toc if Autodoc.configuration.toc
  write_documents
end