Module: ArchivesSpace::Template
- Defined in:
- lib/archivesspace/client/template.rb
Defined Under Namespace
Classes: Erb, Jbuilder, Processor
Class Method Summary
collapse
Class Method Details
.list ⇒ Object
5
6
7
|
# File 'lib/archivesspace/client/template.rb', line 5
def self.list
Dir.glob ["*"], base: File.join(templates_path)
end
|
.process(template, data) ⇒ Object
9
10
11
12
13
|
# File 'lib/archivesspace/client/template.rb', line 9
def self.process(template, data)
processor = File.extname(template).delete(".").camelize
processor = Object.const_get("ArchivesSpace::Template::#{processor}")
processor.new(template, data).process
end
|
.templates_path ⇒ Object
15
16
17
18
19
20
|
# File 'lib/archivesspace/client/template.rb', line 15
def self.templates_path
ENV.fetch(
"ARCHIVESSPACE_CLIENT_TEMPLATES_PATH",
File.join(File.dirname(File.expand_path(__FILE__)), "templates")
)
end
|