Class: Pubsubhubbub::SubscriptionsController

Inherits:
ApplicationController show all
Includes:
Utils
Defined in:
app/controllers/pubsubhubbub/subscriptions_controller.rb

Instance Method Summary collapse

Methods included from Utils

#http_client

Instance Method Details

#indexObject


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/controllers/pubsubhubbub/subscriptions_controller.rb', line 12

def index
  @callback      = params['hub.callback']
  @mode          = params['hub.mode']
  @topic         = params['hub.topic']
  @lease_seconds = params['hub.lease_seconds']
  @secret        = params['hub.secret']
  @url           = params['hub.url']

  case @mode
  when 'subscribe'
    subscribe
  when 'unsubscribe'
    unsubscribe
  when 'publish'
    publish
  else
    raise ValidationError, "Unknown mode: #{@mode}"
  end
end