Class: LinearDispatcher

Inherits:
Dispatcher show all
Defined in:
lib/linear_dispatcher.rb

Direct Known Subclasses

NcrDispatcher

Instance Method Summary collapse

Methods inherited from Dispatcher

deliver_new_cart_emails, #email_approver, #email_observers, #email_sent_confirmation, initialize_dispatcher, on_approval_status_change, #requires_approval_notice?

Instance Method Details

#deliver_new_cart_emails(cart) ⇒ Object


12
13
14
15
# File 'lib/linear_dispatcher.rb', line 12

def deliver_new_cart_emails(cart)
  self.email_next_approver(cart)
  super
end

#email_next_approver(cart) ⇒ Object


6
7
8
9
10
# File 'lib/linear_dispatcher.rb', line 6

def email_next_approver(cart)
  if approval = self.next_approval(cart)
    self.email_approver(approval)
  end
end

#next_approval(cart) ⇒ Object


2
3
4
# File 'lib/linear_dispatcher.rb', line 2

def next_approval(cart)
  cart.ordered_awaiting_approvals.first
end

#on_approval_status_change(approval) ⇒ Object


17
18
19
20
# File 'lib/linear_dispatcher.rb', line 17

def on_approval_status_change(approval)
  self.email_next_approver(approval.cart)
  super
end