From fc3a0068ad8f325895e761f9102d6b596b81344d Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Tue, 4 Sep 2012 00:08:42 -0700 Subject: [PATCH] Fix "instance variable @client not initialized" warning --- lib/twitter.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/twitter.rb b/lib/twitter.rb index 169bbe8b8..3d668a172 100644 --- a/lib/twitter.rb +++ b/lib/twitter.rb @@ -9,11 +9,8 @@ class << self # # @return [Twitter::Client] def client - if @client && @client.cache_key == options.hash - @client - else - @client = Twitter::Client.new(options) - end + @client = Twitter::Client.new(options) unless defined?(@client) && @client.cache_key == options.hash + @client end def respond_to_missing?(method_name, include_private=false); client.respond_to?(method_name, include_private); end if RUBY_VERSION >= "1.9"