class RhetButler::HTMLGenerator::RenderFacade

Public Class Methods

new(templates, item) click to toggle source
# File lib/rhet-butler/html-generator.rb, line 17
def initialize(templates, item)
  @templates = templates
  @item = item
end

Public Instance Methods

method_missing(name, *args, &block) click to toggle source
# File lib/rhet-butler/html-generator.rb, line 22
def method_missing(name, *args, &block)
  @item.__send__(name, *args, &block)
end
render(path, item=nil, locals=nil) click to toggle source
# File lib/rhet-butler/html-generator.rb, line 26
def render(path, item=nil, locals=nil)
  scope = if(item.nil?)
    self
  else
    self.class.new(@templates, item)
  end
  @templates.find(path).contents.render(scope || self, locals || {})
end