Class: SimpleInvoice::Services::AllocateInvoiceNumber

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_invoice/services/allocate_invoice_number.rb

Class Method Summary collapse

Class Method Details

.call(invoice) ⇒ String

Allocate invoice number and apply it to invoice object

Parameters:

Returns:

  • (String)

    invoice number



8
9
10
11
12
# File 'lib/simple_invoice/services/allocate_invoice_number.rb', line 8

def self.call invoice
  next_invoice_number(invoice).tap do |number|
    invoice.invoice_number = number
  end
end