Class: Limarka::Cronograma

Inherits:
Object
  • Object
show all
Defined in:
lib/limarka/cronograma.rb

Overview

Tentativa para criar um modelo de cronograma. Não é utilizado ainda. Ver github.com/abntex/limarka/issues/90

See Also:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tabela: nil, legenda: nil, fonte: nil, rotulo: nil) ⇒ Cronograma

Returns a new instance of Cronograma.



11
12
13
14
15
16
# File 'lib/limarka/cronograma.rb', line 11

def initialize(tabela: nil, legenda: nil, fonte: nil, rotulo: nil)
  self.tabela = tabela
  self.legenda = legenda
  self.fonte = fonte
  self.rotulo = rotulo
end

Instance Attribute Details

#fonteObject

Returns the value of attribute fonte.



9
10
11
# File 'lib/limarka/cronograma.rb', line 9

def fonte
  @fonte
end

#legendaObject

Returns the value of attribute legenda.



9
10
11
# File 'lib/limarka/cronograma.rb', line 9

def legenda
  @legenda
end

#rotuloObject

Returns the value of attribute rotulo.



9
10
11
# File 'lib/limarka/cronograma.rb', line 9

def rotulo
  @rotulo
end

#tabelaObject

Returns the value of attribute tabela.



9
10
11
# File 'lib/limarka/cronograma.rb', line 9

def tabela
  @tabela
end

Class Method Details

.cria_atividades(qtde_atividades, meses, legenda, fonte, rotulo) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/limarka/cronograma.rb', line 18

def self.cria_atividades(qtde_atividades, meses, legenda, fonte, rotulo)
  tabela = [
    ["Etapas", "Março", "Abril", "Maio", "Junho", "Julho"],
    ["1", "\\X", "", "", "", ""],
    ["2", "\\X", "", "", "", ""],
    ["3", "\\X", "", "", "", ""],
    ["4", "\\X", "", "", "", ""],
    ["5", "\\X", "", "", "", ""],
  ]
  Limarka::Cronograma.new(tabela:tabela, legenda:legenda, fonte:fonte, rotulo:rotulo)
end

Instance Method Details

#to_latexObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/limarka/cronograma.rb', line 30

def to_latex
  tex = <<LATEX
\\begin{table}[htb]
\\ABNTEXfontereduzida
\\caption{#{legenda}}
\\label{#{rotulo}}
  \\begin{tabular}{|l||c|c|c|c|c|}
\\hline
\\hline
Fase  &  Março  &  Abril  &  Maio  &  Junho  &  Julho \\\\
\\hline
1     &   \\X    &         &        &         &        \\\\
2     &         &    \\X   &   \\X   &         &        \\\\
3     &         &         &   \\X   &   \\X    &        \\\\
4     &         &         &        &   \\X    &   \\X   \\\\
5     &         &         &        &         &   \\X   \\\\
\\hline
\\hline
  \\end{tabular}
\\legend{Fonte: #{fonte}}
\\end{table}
LATEX
end