Class: Course::VideoNotifier

Inherits:
Notifier::Base
  • Object
show all
Defined in:
app/notifiers/course/video_notifier.rb

Instance Method Summary collapse

Instance Method Details

#video_attempted(user, video) ⇒ Object


3
4
5
6
7
# File 'app/notifiers/course/video_notifier.rb', line 3

def video_attempted(user, video)
  create_activity(actor: user, object: video, event: :attempted).
    notify(video.course, :feed).
    save!
end

#video_closing(user, video) ⇒ Object


9
10
11
12
13
14
15
# File 'app/notifiers/course/video_notifier.rb', line 9

def video_closing(user, video)
  return unless email_enabled?(video, :video_closing)

  activity = create_activity(actor: user, object: video, event: :closing)
  unattempted_users(video).each { |u| activity.notify(u, :email) }
  activity.save!
end