Class: TemplateLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/rdoc/generator/template_loader.rb

Overview

TemplateLoader reads a template from ‘.slim’ file and builds a Template object that may render HTML given a hash with documentation and theme.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ TemplateLoader

Returns a new instance of TemplateLoader.



17
18
19
# File 'lib/rdoc/generator/template_loader.rb', line 17

def initialize(options)
  @options = options
end

Class Method Details

.template_path(name) ⇒ Object



13
14
15
# File 'lib/rdoc/generator/template_loader.rb', line 13

def self.template_path(name)
  Settings.find_file 'templates', '.slim', name
end

.templates_listObject



9
10
11
# File 'lib/rdoc/generator/template_loader.rb', line 9

def self.templates_list
  Settings.list_file_names 'templates', '.slim'
end

Instance Method Details

#loadObject



21
22
23
# File 'lib/rdoc/generator/template_loader.rb', line 21

def load
  Template.new @options.sf_template
end