Class: LiveEvents::ModuleEvent

Inherits:
CanvasSync::LiveEvents::BaseHandler show all
Defined in:
lib/canvas_sync/generators/templates/services/live_events/module_event.rb

Direct Known Subclasses

ModuleCreatedEvent, ModuleUpdatedEvent

Instance Attribute Summary

Attributes inherited from CanvasSync::LiveEvents::BaseHandler

#metadata, #payload, #raw_payload

Attributes inherited from CanvasSync::Job

#job_log

Instance Method Summary collapse

Methods inherited from CanvasSync::LiveEvents::BaseHandler

#perform

Methods inherited from CanvasSync::Job

#create_job_log, #report_checker_wait_time, #update_or_create_model

Instance Method Details

#processObject



6
7
8
9
10
# File 'lib/canvas_sync/generators/templates/services/live_events/module_event.rb', line 6

def process
  return unless payload["context_type"] == "Course"
  context_module = ContextModule.find_or_initialize_by(canvas_id: payload["module_id"])
  context_module.sync_from_api
end