tweet_rest.rb 548 B

1234567891011121314151617181920212223
  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