diff --git a/lib/twitter.rb b/lib/twitter.rb index 6b2bbc69c..7e2a2b2f4 100644 --- a/lib/twitter.rb +++ b/lib/twitter.rb @@ -38,7 +38,7 @@ class << self # # @return [Twitter::Client] def client - @client = Twitter::Client.new(options) unless defined?(@client) && @client.cache_key == options.hash + @client = Twitter::Client.new(options) unless defined?(@client) && @client.hash == options.hash @client end diff --git a/lib/twitter/configurable.rb b/lib/twitter/configurable.rb index 9c642f390..0dc3bac80 100644 --- a/lib/twitter/configurable.rb +++ b/lib/twitter/configurable.rb @@ -1,9 +1,12 @@ +require 'forwardable' require 'twitter/error/configuration_error' module Twitter module Configurable + extend Forwardable attr_writer :consumer_key, :consumer_secret, :oauth_token, :oauth_token_secret attr_accessor :endpoint, :connection_options, :identity_map, :middleware + def_delegator :options, :hash class << self @@ -37,11 +40,6 @@ def credentials? credentials.values.all? end - # @return [Fixnum] - def cache_key - options.hash - end - def reset! Twitter::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", Twitter::Default.options[key]) diff --git a/lib/twitter/tweet.rb b/lib/twitter/tweet.rb index fffdaf2c9..9b11164c4 100644 --- a/lib/twitter/tweet.rb +++ b/lib/twitter/tweet.rb @@ -1,20 +1,23 @@ +require 'forwardable' require 'twitter/creatable' require 'twitter/exceptable' require 'twitter/identity' module Twitter class Tweet < Twitter::Identity + extend Forwardable include Twitter::Creatable include Twitter::Exceptable attr_reader :favorited, :favoriters, :from_user_id, :from_user_name, :in_reply_to_screen_name, :in_reply_to_attrs_id, :in_reply_to_status_id, - :in_reply_to_user_id, :iso_language_code, :profile_image_url, - :profile_image_url_https, :repliers, :retweeted, :retweeters, :source, - :text, :to_user, :to_user_id, :to_user_name, :truncated + :in_reply_to_user_id, :iso_language_code, :repliers, :retweeted, + :retweeters, :source, :text, :to_user, :to_user_id, :to_user_name, + :truncated alias in_reply_to_tweet_id in_reply_to_status_id alias favourited favorited alias favourited? favorited? alias favouriters favoriters + def_delegators :user, :profile_image_url, :profile_image_url_https # @return [Boolean] def entities?