Class: Formatafacil::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/formatafacil/template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTemplate

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

#directoryObject

Derectory of templates



10
11
12
# File 'lib/formatafacil/template.rb', line 10

def directory
  @directory
end

#modelosObject

Returns the value of attribute modelos.



8
9
10
# File 'lib/formatafacil/template.rb', line 8

def modelos
  @modelos
end

Instance Method Details

#executaObject



28
29
# File 'lib/formatafacil/template.rb', line 28

def executa
end

#listObject

$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