Module: Octokit::Client::PubSubHubbub
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/pub_sub_hubbub.rb,
lib/octokit/client/pub_sub_hubbub/service_hooks.rb
Defined Under Namespace
Modules: ServiceHooks
Instance Method Summary collapse
-
#subscribe(topic, callback) ⇒ boolean
Subscribe to a pubsub topic.
-
#unsubscribe(topic, callback) ⇒ boolean
Unsubscribe from a pubsub topic.
Instance Method Details
#subscribe(topic, callback) ⇒ boolean
Subscribe to a pubsub topic
12 13 14 15 16 17 18 19 20 |
# File 'lib/octokit/client/pub_sub_hubbub.rb', line 12 def subscribe(topic, callback) = { :"hub.mode" => "subscribe", :"hub.topic" => topic, :"hub.callback" => callback, } post("/hub", , 3, true, true, true) true end |
#unsubscribe(topic, callback) ⇒ boolean
Unsubscribe from a pubsub topic
30 31 32 33 34 35 36 37 38 |
# File 'lib/octokit/client/pub_sub_hubbub.rb', line 30 def unsubscribe(topic, callback) = { :"hub.mode" => "unsubscribe", :"hub.topic" => topic, :"hub.callback" => callback, } post("/hub", , 3, true, true, true) true end |