class MailHandler::Receiving::Notification::DelayState

base state

Attributes

context[RW]
notified[RW]

Public Class Methods

new(context) click to toggle source
# File lib/mailhandler/receiving/notification/email/states.rb, line 14
def initialize(context)
  @context = context
end

Public Instance Methods

notification_fired() click to toggle source
# File lib/mailhandler/receiving/notification/email/states.rb, line 18
def notification_fired
  @notified = true
end
notify(_search) click to toggle source
# File lib/mailhandler/receiving/notification/email/states.rb, line 22
def notify(_search)
  raise MailHandler::InterfaceError, 'notify(search) interface has to be implemented.'
end

Protected Instance Methods

change_notification_state(search, state) click to toggle source
# File lib/mailhandler/receiving/notification/email/states.rb, line 35
def change_notification_state(search, state)
  context.change_state(state)
  context.notify(search)
end
send_notification_email(type, search) click to toggle source
# File lib/mailhandler/receiving/notification/email/states.rb, line 28
def send_notification_email(type, search)
  return if notified

  context.send_email(type, search)
  notification_fired
end