Sha256: 8349af2ad258773860a74aaa57bb4c92bfc006912d5239a323847af315b072e8

Contents?: true

Size: 916 Bytes

Versions: 22

Compression:

Stored size: 916 Bytes

Contents

module Twitter
  class OAuth
    extend Forwardable
    def_delegators :access_token, :get, :post
    
    attr_reader :ctoken, :csecret
    
    def initialize(ctoken, csecret)
      @ctoken, @csecret = ctoken, csecret
    end
    
    def consumer
      @consumer ||= ::OAuth::Consumer.new(@ctoken, @csecret, {:site => 'http://twitter.com'})
    end
    
    def request_token
      @request_token ||= consumer.get_request_token
    end
    
    def authorize_from_request(rtoken, rsecret)
      request_token = ::OAuth::RequestToken.new(consumer, rtoken, rsecret)
      access_token = request_token.get_access_token
      @atoken, @asecret = access_token.token, access_token.secret
    end
    
    def access_token
      @access_token ||= ::OAuth::AccessToken.new(consumer, @atoken, @asecret)
    end
    
    def authorize_from_access(atoken, asecret)
      @atoken, @asecret = atoken, asecret
    end
  end
end

Version data entries

22 entries across 22 versions & 7 rubygems

Version Path
bkocik-twitter-0.6.10 lib/twitter/oauth.rb
bkocik-twitter-0.6.8 lib/twitter/oauth.rb
bkocik-twitter-0.6.9 lib/twitter/oauth.rb
bkocik-twitter-0.7.0 lib/twitter/oauth.rb
cicloid-twitter-0.6.1 lib/twitter/oauth.rb
cicloid-twitter-0.6.2 lib/twitter/oauth.rb
dacort-twitter-0.6.5 lib/twitter/oauth.rb
deadprogrammer-twitter-0.6.7 lib/twitter/oauth.rb
jnunemaker-twitter-0.6.0 lib/twitter/oauth.rb
jnunemaker-twitter-0.6.1 lib/twitter/oauth.rb
jnunemaker-twitter-0.6.10 lib/twitter/oauth.rb
jnunemaker-twitter-0.6.2 lib/twitter/oauth.rb
jnunemaker-twitter-0.6.3 lib/twitter/oauth.rb
jnunemaker-twitter-0.6.4 lib/twitter/oauth.rb
jnunemaker-twitter-0.6.5 lib/twitter/oauth.rb
jnunemaker-twitter-0.6.6 lib/twitter/oauth.rb
jnunemaker-twitter-0.6.7 lib/twitter/oauth.rb
jnunemaker-twitter-0.6.8 lib/twitter/oauth.rb
jnunemaker-twitter-0.6.9 lib/twitter/oauth.rb
ssoroka-twitter-0.6.7 lib/twitter/oauth.rb