lib/authlogic_connect/oauth/tokens/oauth_token.rb in authlogic-connect-andrewacove-0.5.4 vs lib/authlogic_connect/oauth/tokens/oauth_token.rb in authlogic-connect-andrewacove-0.5.5

- old
+ new

@@ -55,19 +55,16 @@ def oauth_key @oauth_key end - def reset_consumer! + + def consumer if oauth_version == 1.0 - @consumer = OAuth::Consumer.new(credentials[:key], credentials[:secret], config.merge(credentials[:options] || {})) + OAuth::Consumer.new(credentials[:key], credentials[:secret], config.merge(credentials[:options] || {})) else - @consumer = OAuth2::Client.new(credentials[:key], credentials[:secret], config.merge(credentials[:options] || {})) + OAuth2::Client.new(credentials[:key], credentials[:secret], config.merge(credentials[:options] || {})) end - end - - def consumer - @consumer || reset_consumer! end # if we're lucky we can find it by the token. def find_by_key_or_token(key, token, options = {}) result = self.find_by_key(key, options) unless key.nil?