Class: Formatafacil::Template
- Inherits:
-
Object
- Object
- Formatafacil::Template
- Defined in:
- lib/formatafacil/template.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
Derectory of templates.
-
#modelos ⇒ Object
Returns the value of attribute modelos.
Instance Method Summary collapse
- #executa ⇒ Object
-
#initialize ⇒ Template
constructor
A new instance of Template.
-
#list ⇒ Object
$LOAD_PATH.each { |dir| … look for resources relative to dir … }.
Constructor Details
#initialize ⇒ Template
Returns a new instance of Template.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/formatafacil/template.rb', line 12 def initialize() @modelos = {} # ler os templates do projeto formatafacil-templates $LOAD_PATH.each { |dir| files = Dir["#{dir}/formatafacil/templates/*.latex"] files.each { |file| if file @modelos[File.basename(file, '.tex')] = file @directory = "#{dir}/formatafacil" end } } end |
Instance Attribute Details
#directory ⇒ Object
Derectory of templates
10 11 12 |
# File 'lib/formatafacil/template.rb', line 10 def directory @directory end |
#modelos ⇒ Object
Returns the value of attribute modelos.
8 9 10 |
# File 'lib/formatafacil/template.rb', line 8 def modelos @modelos end |
Instance Method Details
#executa ⇒ Object
28 29 |
# File 'lib/formatafacil/template.rb', line 28 def executa end |
#list ⇒ Object
$LOAD_PATH.each { |dir| … look for resources relative to dir … }
32 33 34 |
# File 'lib/formatafacil/template.rb', line 32 def list modelos.keys end |