class Qddrud::ReadmeTemplate
Constructs a new ERB object for rendering a Readme.md file.
Public Instance Methods
render(template)
click to toggle source
Desribe the behaviour of the method
Attributes¶ ↑
-
:template
- The template to render against.
Examples¶ ↑
Assuming this is the content of template.erb:
My metadata is <%= metadata %>
You would render it with the following:
markdown = ReadmeTemplate.new(metadata: @metadata) markdown.render(File.read('template.erb'))
# File lib/qddrud/readme.rb, line 20 def render(template) ERB.new(template).result(binding) end