Class: RamlDoc::View

Inherits:
Object
  • Object
show all
Includes:
RamlHelper
Defined in:
lib/raml_doc/view.rb

Instance Method Summary collapse

Methods included from RamlHelper

#max_parameter

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.expand_path("../templates", __FILE__), "#{template}.html.erb")
  template = ERB.new(File.read(template_path))
  template.result binding
end