Class: Slideshift::Tool::Presentation
- Inherits:
-
Object
- Object
- Slideshift::Tool::Presentation
- Defined in:
- lib/slideshift/tool/presentation.rb
Instance Method Summary collapse
-
#initialize(dir = ".", static = '/static') ⇒ Presentation
constructor
A new instance of Presentation.
- #load ⇒ Object
- #render ⇒ Object
- #static(file) ⇒ Object
Constructor Details
#initialize(dir = ".", static = '/static') ⇒ Presentation
Returns a new instance of Presentation.
7 8 9 10 11 |
# File 'lib/slideshift/tool/presentation.rb', line 7 def initialize(dir = ".", static = '/static') @dir = dir @static = static @render = Render::Markdown.new(@dir) end |
Instance Method Details
#load ⇒ Object
17 18 19 20 21 22 |
# File 'lib/slideshift/tool/presentation.rb', line 17 def load template = File.read(File.("../template.erb", __FILE__)) template = File.read("#{@dir}/template.erb") if File.exists?("#{@dir}/template.erb") @template = ERB.new(template) @render.load end |
#render ⇒ Object
24 25 26 |
# File 'lib/slideshift/tool/presentation.rb', line 24 def render @template.result(binding) end |
#static(file) ⇒ Object
13 14 15 |
# File 'lib/slideshift/tool/presentation.rb', line 13 def static(file) File.join(@static, file) end |