Class: RspecApiDocs::Renderer::SlateRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_api_docs/formatter/renderer/slate_renderer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resources) ⇒ SlateRenderer


6
7
8
# File 'lib/rspec_api_docs/formatter/renderer/slate_renderer.rb', line 6

def initialize(resources)
  @resources = resources
end

Instance Attribute Details

#resourcesObject (readonly)

Returns the value of attribute resources


4
5
6
# File 'lib/rspec_api_docs/formatter/renderer/slate_renderer.rb', line 4

def resources
  @resources
end

Instance Method Details

#renderObject


10
11
12
13
14
15
16
# File 'lib/rspec_api_docs/formatter/renderer/slate_renderer.rb', line 10

def render
  FileUtils.mkdir_p output_file.dirname

  File.open(output_file, 'w') do |f|
    f.write ERB.new(File.read(template), nil, '-').result(binding)
  end
end