Class: Limarka::Pdfconf
- Inherits:
-
Object
- Object
- Limarka::Pdfconf
- Defined in:
- lib/limarka/pdfconf.rb
Instance Attribute Summary collapse
-
#pdf ⇒ Object
readonly
Returns the value of attribute pdf.
Instance Method Summary collapse
- #exporta(valida = true) ⇒ Object
-
#initialize(pdf: nil) ⇒ Pdfconf
constructor
A new instance of Pdfconf.
- #update(field, value) ⇒ Object
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
#pdf ⇒ Object (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 |