Class: Deas::TemplateEngine
- Inherits:
-
Object
- Object
- Deas::TemplateEngine
- Defined in:
- lib/deas/template_engine.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#source_path ⇒ Object
readonly
Returns the value of attribute source_path.
Instance Method Summary collapse
- #compile(template_name, compiled_content) ⇒ Object
-
#initialize(opts = nil) ⇒ TemplateEngine
constructor
A new instance of TemplateEngine.
- #partial(template_name, locals, &content) ⇒ Object
- #render(template_name, view_handler, locals, &content) ⇒ Object
Constructor Details
#initialize(opts = nil) ⇒ TemplateEngine
Returns a new instance of TemplateEngine.
10 11 12 13 14 |
# File 'lib/deas/template_engine.rb', line 10 def initialize(opts = nil) @opts = opts || {} @source_path = Pathname.new(@opts['source_path'].to_s) @logger = @opts['logger'] || Deas::NullLogger.new end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
8 9 10 |
# File 'lib/deas/template_engine.rb', line 8 def logger @logger end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
8 9 10 |
# File 'lib/deas/template_engine.rb', line 8 def opts @opts end |
#source_path ⇒ Object (readonly)
Returns the value of attribute source_path.
8 9 10 |
# File 'lib/deas/template_engine.rb', line 8 def source_path @source_path end |
Instance Method Details
#compile(template_name, compiled_content) ⇒ Object
24 25 26 |
# File 'lib/deas/template_engine.rb', line 24 def compile(template_name, compiled_content) raise NotImplementedError end |
#partial(template_name, locals, &content) ⇒ Object
20 21 22 |
# File 'lib/deas/template_engine.rb', line 20 def partial(template_name, locals, &content) raise NotImplementedError end |
#render(template_name, view_handler, locals, &content) ⇒ Object
16 17 18 |
# File 'lib/deas/template_engine.rb', line 16 def render(template_name, view_handler, locals, &content) raise NotImplementedError end |