Class: RevealCK::TemplateProcessor
- Inherits:
-
Object
- Object
- RevealCK::TemplateProcessor
- Defined in:
- lib/reveal-ck/template_processor.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file) ⇒ TemplateProcessor
constructor
A new instance of TemplateProcessor.
- #output(scope = nil, locals = {}) ⇒ Object
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.(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 |