Class: RhetButler::Web::AssetsApp::AssetsContext

Inherits:
Object
  • Object
show all
Defined in:
lib/rhet-butler/web/assets-app.rb

Instance Method Summary collapse

Constructor Details

#initialize(template_handler) ⇒ AssetsContext

Returns a new instance of AssetsContext.



11
12
13
# File 'lib/rhet-butler/web/assets-app.rb', line 11

def initialize(template_handler)
  @template_handler = template_handler
end

Instance Method Details

#render(path, locals = nil) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/rhet-butler/web/assets-app.rb', line 15

def render(path, locals = nil)
  template = @template_handler.find(path).contents
  if template.respond_to? :render
    template.render(self, locals)
  else
    template
  end
end