lib/tw/client/auth.rb in tw-0.5.2 vs lib/tw/client/auth.rb in tw-1.0.0

- old
+ new

@@ -1,17 +1,25 @@ module Tw class Client + def self.client + @@client + end + + def self.client=(client) + @@client = client + end + def auth(user=nil) - Auth.auth user + self.class.client = @rest_client = Auth.auth user end end class Auth def self.auth(user=nil) user = get_or_regist_user user - Twitter.configure do |c| + return Twitter::REST::Client.new do |c| c.consumer_key = Conf['consumer_key'] c.consumer_secret = Conf['consumer_secret'] c.oauth_token = user['access_token'] c.oauth_token_secret = user['access_secret'] end