tweet_rest.rb 549 B

123456789101112131415161718192021222324
  1. # Copyright (C) 2012-2015 Zammad Foundation, http://zammad-foundation.org/
  2. class TweetRest < TweetBase
  3. attr_accessor :client
  4. def initialize(auth)
  5. @connection_type = 'rest'
  6. @client = Twitter::REST::Client.new do |config|
  7. config.consumer_key = auth[:consumer_key]
  8. config.consumer_secret = auth[:consumer_secret]
  9. config.access_token = auth[:oauth_token]
  10. config.access_token_secret = auth[:oauth_token_secret]
  11. end
  12. end
  13. def disconnect
  14. return if !@client
  15. @client = nil
  16. end
  17. end