Class: Pubsubhubbub::VerifyIntentJob

Inherits:
ApplicationJob show all
Includes:
Utils
Defined in:
app/jobs/pubsubhubbub/verify_intent_job.rb

Instance Method Summary collapse

Methods included from Utils

#http_client

Instance Method Details

#perform(subscription_id) ⇒ Object


8
9
10
11
12
13
14
15
16
17
# File 'app/jobs/pubsubhubbub/verify_intent_job.rb', line 8

def perform(subscription_id)
  subscription = Subscription.find(subscription_id)
  verified     = verify_intent(subscription)

  if verified && subscription.mode == 'subscribe'
    subscription.update(confirmed: true)
  else
    subscription.destroy
  end
end