Skip to content

Commit

Permalink
Delegate Tweet#profile_image_url and Tweet#profile_image_url_https to…
Browse files Browse the repository at this point in the history
… Tweet#user

Closes #340.
  • Loading branch information
sferik committed Jan 6, 2013
1 parent 884a706 commit 7bd6f8f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/twitter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 3 additions & 5 deletions lib/twitter/configurable.rb
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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])
Expand Down
9 changes: 6 additions & 3 deletions lib/twitter/tweet.rb
Original file line number Diff line number Diff line change
@@ -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?
Expand Down

0 comments on commit 7bd6f8f

Please sign in to comment.