Class: RevealCK::TemplateProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/reveal-ck/template_processor.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ TemplateProcessor

Returns a new instance of TemplateProcessor.



11
12
13
# File 'lib/reveal-ck/template_processor.rb', line 11

def initialize(file)
  @template = Tilt.new file
end

Class Method Details

.open(path) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/reveal-ck/template_processor.rb', line 19

def self.open(path)
  file = if File.exists? path
           path
         else
           File.expand_path(File.join(Dir.pwd, path))
         end
  TemplateProcessor.new file
end

Instance Method Details

#output(scope = nil, locals = {}) ⇒ Object



15
16
17
# File 'lib/reveal-ck/template_processor.rb', line 15

def output(scope=nil, locals = {})
  @template.render scope, locals
end