Class: Contentful::Scheduler::Controller

Inherits:
Webhook::Listener::Controllers::WebhookAware
  • Object
show all
Defined in:
lib/contentful/scheduler/controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject Also known as: save, auto_save, unarchive



7
8
9
10
11
12
13
# File 'lib/contentful/scheduler/controller.rb', line 7

def create
  return unless webhook.entry?

  logger.info "Queueing - Space: #{webhook.space_id} - Entry: #{webhook.id}"

  Queue.instance(logger).update_or_create(webhook)
end

#deleteObject Also known as: unpublish, archive, publish



18
19
20
21
22
23
24
# File 'lib/contentful/scheduler/controller.rb', line 18

def delete
  return unless webhook.entry?

  logger.info "Unqueueing - Space: #{webhook.space_id} - Entry: #{webhook.id}"

  Queue.instance(logger).remove(webhook)
end