Class: Yuzu::Renderers::GalleryRenderer

Inherits:
Renderer show all
Defined in:
lib/yuzu/renderers/gallery.rb

Instance Method Summary collapse

Methods inherited from Renderer

#initialize, registry, renderers

Constructor Details

This class inherits a constructor from Yuzu::Renderers::Renderer

Instance Method Details



10
11
12
# File 'lib/yuzu/renderers/gallery.rb', line 10

def gallery_template
  @template ||= Yuzu::Core::HamlTemplate.new(template_name)
end

#render(website_file) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/yuzu/renderers/gallery.rb', line 14

def render(website_file)
  if gallery_template.exists?
    gallery_template.render(website_file, {:images => website_file.images})
  else
    Html::Comment.new << "Couldn't find gallery template #{gallery_template.path.absolute}"
  end
end

#template_nameObject



6
7
8
# File 'lib/yuzu/renderers/gallery.rb', line 6

def template_name
  "_gallery.haml"
end