lib/twitter/user.rb in twitter-5.11.0 vs lib/twitter/user.rb in twitter-5.12.0
- old
+ new
@@ -8,21 +8,22 @@
module Twitter
class User < Twitter::BasicUser
include Twitter::Creatable
include Twitter::Profile
include Memoizable
- attr_reader :connections, :description, :favourites_count,
- :followers_count, :friends_count, :lang, :listed_count,
- :location, :name, :profile_background_color,
- :profile_background_image_url,
- :profile_background_image_url_https, :profile_link_color,
+ # @return [Array]
+ attr_reader :connections
+ # @return [Integer]
+ attr_reader :favourites_count, :followers_count, :friends_count,
+ :listed_count, :statuses_count, :utc_offset
+ # @return [String]
+ attr_reader :description, :lang, :location, :name,
+ :profile_background_color, :profile_link_color,
:profile_sidebar_border_color, :profile_sidebar_fill_color,
- :profile_text_color, :statuses_count, :time_zone, :utc_offset
+ :profile_text_color, :time_zone
alias_method :favorites_count, :favourites_count
remove_method :favourites_count
- alias_method :profile_background_image_uri, :profile_background_image_url
- alias_method :profile_background_image_uri_https, :profile_background_image_url_https
alias_method :tweets_count, :statuses_count
object_attr_reader :Tweet, :status, :user
alias_method :tweet, :status
alias_method :tweet?, :status?
alias_method :tweeted?, :status?
@@ -31,10 +32,11 @@
:geo_enabled, :muting, :needs_phone_verification,
:notifications, :protected, :profile_background_tile,
:profile_use_background_image, :suspended, :verified
define_predicate_method :translator, :is_translator
define_predicate_method :translation_enabled, :is_translation_enabled
+ uri_attr_reader :profile_background_image_uri, :profile_background_image_uri_https
class << self
private
# Dynamically define a method for entity URIs
@@ -76,20 +78,20 @@
def entities?
!@attrs[:entities].nil? && @attrs[:entities].any? { |_, hash| hash[:urls].any? }
end
memoize :entities?
- # @return [String] The URL to the user.
+ # @return [Addressable::URI] The URL to the user.
def uri
- Addressable::URI.parse("https://twitter.com/#{screen_name}") unless screen_name.nil?
+ Addressable::URI.parse("https://twitter.com/#{screen_name}") if screen_name?
end
memoize :uri
alias_method :url, :uri
- # @return [String] The URL to the user's website.
+ # @return [Addressable::URI] The URL to the user's website.
def website
- if website_urls?
- website_urls.first.expanded_url
+ if website_uris?
+ website_uris.first.expanded_url
else
Addressable::URI.parse(@attrs[:url])
end
end
memoize :website