class RspecApiDocumentation::ApiDocumentation

Attributes

configuration[R]
index[R]

Public Class Methods

new(configuration) click to toggle source
# File lib/rspec_api_documentation/api_documentation.rb, line 9
def initialize(configuration)
  @configuration = configuration
  @index = Index.new
end

Public Instance Methods

clear_docs() click to toggle source
# File lib/rspec_api_documentation/api_documentation.rb, line 14
def clear_docs
  writers.each do |writer|
    writer.clear_docs(docs_dir)
  end
end
document_example(rspec_example) click to toggle source
# File lib/rspec_api_documentation/api_documentation.rb, line 20
def document_example(rspec_example)
  example = Example.new(rspec_example, configuration)
  if example.should_document?
    index.examples << example
  end
end
write() click to toggle source
# File lib/rspec_api_documentation/api_documentation.rb, line 27
def write
  writers.each do |writer|
    writer.write(index, configuration)
  end
end
writers() click to toggle source
# File lib/rspec_api_documentation/api_documentation.rb, line 33
def writers
  [*configuration.format].map do |format|
    RspecApiDocumentation::Writers.const_get("#{format}_writer".classify)
  end
end