Class: RspecApiDocs::Renderer::SlateRenderer
- Inherits:
-
Object
- Object
- RspecApiDocs::Renderer::SlateRenderer
- Defined in:
- lib/rspec_api_docs/formatter/renderer/slate_renderer.rb
Instance Attribute Summary collapse
-
#resources ⇒ Object
readonly
Returns the value of attribute resources.
Instance Method Summary collapse
-
#initialize(resources) ⇒ SlateRenderer
constructor
A new instance of SlateRenderer.
- #render ⇒ Object
Constructor Details
#initialize(resources) ⇒ SlateRenderer
Returns a new instance of 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
#resources ⇒ Object (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
#render ⇒ Object
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 |