lib/tumbz/user.rb in tumbz-0.0.4 vs lib/tumbz/user.rb in tumbz-0.0.5
- old
+ new
@@ -5,15 +5,19 @@
uses_api Tumbz.api
custom_get :search
def self.sign_in!(email, password)
post_raw("auth", :email => email, :password => password) do |parsed_data|
- Tumbz.access_token = parsed_data[:data][:access_token]
+ Thread.current[:tumbz_access_token] = parsed_data[:data][:access_token]
end
end
+ def self.set_access_token!(access_token)
+ Thread.current[:tumbz_access_token] = access_token
+ end
+
def self.sign_out!
- Tumbz.access_token = nil
- Tumbz.access_token.nil?
+ Thread.current[:tumbz_access_token] = nil
+ Thread.current[:tumbz_access_token].nil?
end
end
end