Class: Slider::Document
- Inherits:
-
Object
- Object
- Slider::Document
- Defined in:
- lib/slider/document.rb
Instance Method Summary collapse
-
#initialize(name, template) ⇒ Document
constructor
A new instance of Document.
- #render ⇒ Object
Constructor Details
#initialize(name, template) ⇒ Document
Returns a new instance of Document.
7 8 9 10 11 |
# File 'lib/slider/document.rb', line 7 def initialize(name, template) @name = name @file = File.read("#{name}.md") @template = ERB.new(File.read(File.(File.join('..', '..', '..', 'templates', "#{template}.erb"), __FILE__))) end |
Instance Method Details
#render ⇒ Object
13 14 15 16 |
# File 'lib/slider/document.rb', line 13 def render @content = Kramdown::Document.new(@file, :input => 'Slider').to_html @template.result(binding) end |