Class: SimpleInvoice::Services::ProcessSubscription

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(date, subscription) ⇒ nil, SimpleInvoice::Invoice

Parameters:

Returns:



8
9
10
# File 'lib/simple_invoice/services/process_subscription.rb', line 8

def self.call date, subscription
  new(date, subscription).maybe_invoice
end

Instance Method Details

#maybe_invoicenil, SimpleInvoice::Invoice

Returns:



13
14
15
16
17
18
19
# File 'lib/simple_invoice/services/process_subscription.rb', line 13

def maybe_invoice
  if should_create_an_invoice_today?
    create_invoice
  else
    nil
  end
end