Class: Dorsale::BillingMachine::PdfFileGenerator

Inherits:
Service
  • Object
show all
Defined in:
app/services/dorsale/billing_machine/pdf_file_generator.rb

Defined Under Namespace

Classes: StringIO

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Service

call

Constructor Details

#initialize(document) ⇒ PdfFileGenerator

Returns a new instance of PdfFileGenerator.



4
5
6
7
# File 'app/services/dorsale/billing_machine/pdf_file_generator.rb', line 4

def initialize(document)
  super()
  @document = document
end

Instance Attribute Details

#documentObject (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

#callObject



9
10
11
12
13
# File 'app/services/dorsale/billing_machine/pdf_file_generator.rb', line 9

def call
  document.pdf_file = file
  document.save! if document.persisted?
  document
end