Class: Typingpool::Template::Assignment

Inherits:
Typingpool::Template show all
Defined in:
lib/typingpool/template/assignment.rb

Overview

A Template::Assignment works just like a regular template, except that within each transcript dir (Config#transcript and the built-in app template dir) we search within a subdir called ‘assignment’ first, then, after all the ‘assignment’ subdirs have been search, we look in the original template dirs.

Instance Attribute Summary

Attributes inherited from Typingpool::Template

#look_in

Class Method Summary collapse

Methods inherited from Typingpool::Template

from_config, #full_path, #initialize, #read, #render, #render_with_binding, validate_config

Constructor Details

This class inherits a constructor from Typingpool::Template

Class Method Details

.look_in_from_config(*args) ⇒ Object



10
11
12
13
14
# File 'lib/typingpool/template/assignment.rb', line 10

def self.look_in_from_config(*args)
  look_in = super(*args)
  look_in.unshift(look_in.reject{|dir| dir.empty? }.map{|dir| File.join(dir, 'assignment') })
  look_in.flatten
end