lib/archivesspace/client/template.rb in archivesspace-client-0.1.6 vs lib/archivesspace/client/template.rb in archivesspace-client-0.1.7
- old
+ new
@@ -1,25 +1,23 @@
-module ArchivesSpace
+# frozen_string_literal: true
+module ArchivesSpace
module Template
-
def self.list
[]
end
def self.process_template(template, data)
- t = ERB.new(self.read_template(template))
- r = t.result(binding).gsub(/\n+/,"\n")
+ t = ERB.new(read_template(template))
+ r = t.result(binding).gsub(/\n+/, "\n")
JSON.parse(r)
end
def self.read_template(file)
- File.read("#{self.templates_path}/#{file.to_s}.json.erb")
+ File.read("#{templates_path}/#{file}.json.erb")
end
def self.templates_path
File.join(File.dirname(File.expand_path(__FILE__)), 'templates')
end
-
end
-
-end
\ No newline at end of file
+end