Class: OAuthPubSubJack
- Inherits:
-
Object
- Object
- OAuthPubSubJack
- Defined in:
- lib/switchboard/jacks/oauth_pubsub.rb
Overview
TODO subclass PubSubJack
Class Method Summary collapse
Class Method Details
.connect(switchboard, settings) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/switchboard/jacks/oauth_pubsub.rb', line 5 def self.connect(switchboard, settings) # TODO generalize this pattern for required settings unless settings["pubsub.server"] puts "A pubsub server must be specified." return false end switchboard.extend(Switchboard::Helpers::OAuthPubSubHelper) switchboard.on_startup do @pubsub = Jabber::PubSub::OAuthServiceHelper.new(client, settings["pubsub.server"]) @oauth_consumer = OAuth::Consumer.new(settings["oauth.consumer_key"], settings["oauth.consumer_secret"]) @oauth_token = OAuth::Token.new(settings["oauth.token"], settings["oauth.token_secret"]) @pubsub.add_event_callback do |event| on(:pubsub_event, event) end end end |