Class: RamlDoc::View
- Inherits:
-
Object
- Object
- RamlDoc::View
- Includes:
- RamlHelper
- Defined in:
- lib/raml_doc/view.rb
Instance Method Summary collapse
-
#initialize(raml) ⇒ View
constructor
A new instance of View.
- #markdown(string) ⇒ Object
- #render(template) ⇒ Object
Methods included from RamlHelper
Constructor Details
#initialize(raml) ⇒ View
Returns a new instance of View.
8 9 10 |
# File 'lib/raml_doc/view.rb', line 8 def initialize(raml) @raml = raml end |
Instance Method Details
#markdown(string) ⇒ Object
18 19 20 |
# File 'lib/raml_doc/view.rb', line 18 def markdown(string) Kramdown::Document.new(string).to_html end |
#render(template) ⇒ Object
12 13 14 15 16 |
# File 'lib/raml_doc/view.rb', line 12 def render(template) template_path = File.join(File.("../templates", __FILE__), "#{template}.html.erb") template = ERB.new(File.read(template_path)) template.result binding end |