Class: Sanford::Nm::TemplateEngine
- Inherits:
-
TemplateEngine
- Object
- TemplateEngine
- Sanford::Nm::TemplateEngine
- Defined in:
- lib/sanford-nm.rb
Constant Summary collapse
- DEFAULT_HANDLER_LOCAL =
'view'.freeze
- DEFAULT_LOGGER_LOCAL =
'logger'.freeze
Instance Method Summary collapse
- #nm_handler_local ⇒ Object
- #nm_logger_local ⇒ Object
- #nm_source ⇒ Object
- #partial(path, locals) ⇒ Object
- #render(path, service_handler, locals) ⇒ Object
Instance Method Details
#nm_handler_local ⇒ Object
20 21 22 |
# File 'lib/sanford-nm.rb', line 20 def nm_handler_local @nm_handler_local ||= (self.opts['handler_local'] || DEFAULT_HANDLER_LOCAL) end |
#nm_logger_local ⇒ Object
24 25 26 |
# File 'lib/sanford-nm.rb', line 24 def nm_logger_local @nm_logger_local ||= (self.opts['logger_local'] || DEFAULT_LOGGER_LOCAL) end |
#nm_source ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/sanford-nm.rb', line 12 def nm_source @nm_source ||= Nm::Source.new(self.source_path, { :cache => self.opts['cache'], :ext => self.opts['ext'], :locals => { self.nm_logger_local => self.logger } }) end |
#partial(path, locals) ⇒ Object
32 33 34 |
# File 'lib/sanford-nm.rb', line 32 def partial(path, locals) self.nm_source.partial(path, locals) end |
#render(path, service_handler, locals) ⇒ Object
28 29 30 |
# File 'lib/sanford-nm.rb', line 28 def render(path, service_handler, locals) self.nm_source.render(path, render_locals(service_handler, locals)) end |