Class: Limarka::Pdfconf

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pdf: nil) ⇒ Pdfconf

Returns a new instance of Pdfconf.



14
15
16
# File 'lib/limarka/pdfconf.rb', line 14

def initialize(pdf: nil)
  @pdf = pdf
end

Instance Attribute Details

#pdfObject (readonly)

Returns the value of attribute pdf.



12
13
14
# File 'lib/limarka/pdfconf.rb', line 12

def pdf
  @pdf
end

Instance Method Details

#exporta(valida = true) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/limarka/pdfconf.rb', line 22

def exporta(valida=true)
  h = {}
  h.merge! caixas_de_texto
  h.merge! nivel_educacao
  h.merge! ficha_catalografica
  h.merge! folha_de_aprovacao
  h.merge! projeto
  h.merge! apendices
  h.merge! anexos
  h.merge! errata
  h.merge! referencias
  h.merge! lista_ilustracoes
  h.merge! lista_tabelas
  h.merge! lista_siglas

  
  # TODO: converter para chaves?
  valida_campos(h) if valida
  h
end

#update(field, value) ⇒ Object



18
19
20
# File 'lib/limarka/pdfconf.rb', line 18

def update(field, value)
  pdf.field(field).instance_variable_set(:@value, value)
end