Class: Limarka::Cronograma
- Inherits:
-
Object
- Object
- Limarka::Cronograma
- 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
Instance Attribute Summary collapse
-
#fonte ⇒ Object
Returns the value of attribute fonte.
-
#legenda ⇒ Object
Returns the value of attribute legenda.
-
#rotulo ⇒ Object
Returns the value of attribute rotulo.
-
#tabela ⇒ Object
Returns the value of attribute tabela.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(tabela: nil, legenda: nil, fonte: nil, rotulo: nil) ⇒ Cronograma
constructor
A new instance of Cronograma.
- #to_latex ⇒ Object
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
#fonte ⇒ Object
Returns the value of attribute fonte.
9 10 11 |
# File 'lib/limarka/cronograma.rb', line 9 def fonte @fonte end |
#legenda ⇒ Object
Returns the value of attribute legenda.
9 10 11 |
# File 'lib/limarka/cronograma.rb', line 9 def legenda @legenda end |
#rotulo ⇒ Object
Returns the value of attribute rotulo.
9 10 11 |
# File 'lib/limarka/cronograma.rb', line 9 def rotulo @rotulo end |
#tabela ⇒ Object
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_latex ⇒ Object
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 = "\\\\begin{table}[htb]\n\\\\ABNTEXfontereduzida\n\\\\caption{\#{legenda}}\n\\\\label{\#{rotulo}}\n \\\\begin{tabular}{|l||c|c|c|c|c|}\n\\\\hline\n\\\\hline\nFase & Mar\u00E7o & Abril & Maio & Junho & Julho \\\\\\\\\n\\\\hline\n1 & \\\\X & & & & \\\\\\\\\n2 & & \\\\X & \\\\X & & \\\\\\\\\n3 & & & \\\\X & \\\\X & \\\\\\\\\n4 & & & & \\\\X & \\\\X \\\\\\\\\n5 & & & & & \\\\X \\\\\\\\\n\\\\hline\n\\\\hline\n \\\\end{tabular}\n\\\\legend{Fonte: \#{fonte}}\n\\\\end{table}\n" end |