Class: RspecApiDocumentation::Writers::Writer

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_api_documentation/writers/writer.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index, configuration) ⇒ Writer

Returns a new instance of Writer.



6
7
8
9
# File 'lib/rspec_api_documentation/writers/writer.rb', line 6

def initialize(index, configuration)
  self.index = index
  self.configuration = configuration
end

Instance Attribute Details

#configurationObject

Returns the value of attribute configuration.



4
5
6
# File 'lib/rspec_api_documentation/writers/writer.rb', line 4

def configuration
  @configuration
end

#indexObject

Returns the value of attribute index.



4
5
6
# File 'lib/rspec_api_documentation/writers/writer.rb', line 4

def index
  @index
end

Class Method Details

.clear_docs(docs_dir) ⇒ Object



16
17
18
19
20
21
# File 'lib/rspec_api_documentation/writers/writer.rb', line 16

def self.clear_docs(docs_dir)
  if File.exists?(docs_dir)
    FileUtils.rm_rf(docs_dir, :secure => true)
  end
  FileUtils.mkdir_p(docs_dir)
end

.write(index, configuration) ⇒ Object



11
12
13
14
# File 'lib/rspec_api_documentation/writers/writer.rb', line 11

def self.write(index, configuration)
  writer = new(index, configuration)
  writer.write
end