Class: Dorsale::BillingMachine::PdfFileGenerator
- Defined in:
- app/services/dorsale/billing_machine/pdf_file_generator.rb
Defined Under Namespace
Classes: StringIO
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(document) ⇒ PdfFileGenerator
constructor
A new instance of PdfFileGenerator.
Methods inherited from Service
Constructor Details
#initialize(document) ⇒ PdfFileGenerator
Returns a new instance of PdfFileGenerator.
4 5 6 7 8 9 10 11 |
# File 'app/services/dorsale/billing_machine/pdf_file_generator.rb', line 4 def initialize(document) # I have no idea why I need to do that, # if I don't do that, CarrierWare do not stores the file. # The reload() method don't work either. # The problem appears only on server, not in console. # I think CarrierWave do not work anymore after first save. @document = document.class.find(document.id) end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
2 3 4 |
# File 'app/services/dorsale/billing_machine/pdf_file_generator.rb', line 2 def document @document end |
Instance Method Details
#call ⇒ Object
13 14 15 |
# File 'app/services/dorsale/billing_machine/pdf_file_generator.rb', line 13 def call document.update!(pdf_file: file) end |