class Sanford::Nm::TemplateEngine

Constants

DEFAULT_HANDLER_LOCAL
DEFAULT_LOGGER_LOCAL

Public Instance Methods

nm_handler_local() click to toggle source
# 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() click to toggle source
# File lib/sanford-nm.rb, line 24
def nm_logger_local
  @nm_logger_local ||= (self.opts['logger_local'] || DEFAULT_LOGGER_LOCAL)
end
nm_source() click to toggle source
# 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) click to toggle source
# File lib/sanford-nm.rb, line 32
def partial(path, locals)
  self.nm_source.partial(path, locals)
end
render(path, service_handler, locals) click to toggle source
# File lib/sanford-nm.rb, line 28
def render(path, service_handler, locals)
  self.nm_source.render(path, render_locals(service_handler, locals))
end

Private Instance Methods

render_locals(service_handler, locals) click to toggle source
# File lib/sanford-nm.rb, line 38
def render_locals(service_handler, locals)
  { self.nm_handler_local => service_handler }.merge(locals)
end