Class: Slideshift::Tool::Presentation

Inherits:
Object
  • Object
show all
Defined in:
lib/slideshift/tool/presentation.rb

Instance Method Summary collapse

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

#loadObject



17
18
19
20
21
22
# File 'lib/slideshift/tool/presentation.rb', line 17

def load
  template = File.read(File.expand_path("../template.erb", __FILE__))
  template = File.read("#{@dir}/template.erb") if File.exists?("#{@dir}/template.erb")
  @template = ERB.new(template)
  @render.load
end

#renderObject



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