Sha256: 50494cd486b9afb147100fb1bcef22a3d0163bc57652ae5a010b0eb9d9e8c8f8

Contents?: true

Size: 469 Bytes

Versions: 7

Compression:

Stored size: 469 Bytes

Contents

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")
      JSON.parse(r)
    end

    def self.read_template(file)
      File.read("#{self.templates_path}/#{file.to_s}.json.erb")
    end

    def self.templates_path
      File.join(File.dirname(File.expand_path(__FILE__)), 'templates')
    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
archivesspace-client-0.1.6 lib/archivesspace/client/template.rb
archivesspace-client-0.1.5 lib/archivesspace/client/template.rb
archivesspace-client-0.1.4 lib/archivesspace/client/template.rb
archivesspace-client-0.1.3 lib/archivesspace/client/template.rb
archivesspace-client-0.1.2 lib/archivesspace/client/template.rb
archivesspace-client-0.1.1 lib/archivesspace/client/template.rb
archivesspace-client-0.1.0 lib/archivesspace/client/template.rb