Class: Twitter::User
Constant Summary
Constants included
from Profile
Profile::PREDICATE_URI_METHOD_REGEX, Profile::PROFILE_IMAGE_SUFFIX_REGEX
Instance Attribute Summary collapse
Attributes inherited from BasicUser
#screen_name
Attributes inherited from Identity
#id
Attributes inherited from Base
#attrs
Instance Method Summary
collapse
Methods included from Profile
#profile_banner_uri, #profile_banner_uri?, #profile_banner_uri_https, #profile_image_uri, #profile_image_uri?, #profile_image_uri_https
Methods included from Creatable
#created?, #created_at
Methods inherited from Identity
#initialize
Methods inherited from Base
#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, display_uri_attr_reader, #initialize, object_attr_reader, predicate_attr_reader, uri_attr_reader
Methods included from Utils
flat_pmap, pmap
Instance Attribute Details
#connections ⇒ Array
12
13
14
|
# File 'lib/twitter/user.rb', line 12
def connections
@connections
end
|
#description ⇒ String
17
18
19
|
# File 'lib/twitter/user.rb', line 17
def description
@description
end
|
#email ⇒ String
17
18
19
|
# File 'lib/twitter/user.rb', line 17
def email
@email
end
|
#favourites_count ⇒ Integer
Also known as:
favorites_count
14
15
16
|
# File 'lib/twitter/user.rb', line 14
def favourites_count
@favourites_count
end
|
#followers_count ⇒ Integer
14
15
16
|
# File 'lib/twitter/user.rb', line 14
def followers_count
@followers_count
end
|
#friends_count ⇒ Integer
14
15
16
|
# File 'lib/twitter/user.rb', line 14
def friends_count
@friends_count
end
|
#lang ⇒ String
17
18
19
|
# File 'lib/twitter/user.rb', line 17
def lang
@lang
end
|
#listed_count ⇒ Integer
14
15
16
|
# File 'lib/twitter/user.rb', line 14
def listed_count
@listed_count
end
|
#location ⇒ String
17
18
19
|
# File 'lib/twitter/user.rb', line 17
def location
@location
end
|
#name ⇒ String
17
18
19
|
# File 'lib/twitter/user.rb', line 17
def name
@name
end
|
#profile_background_color ⇒ String
17
18
19
|
# File 'lib/twitter/user.rb', line 17
def profile_background_color
@profile_background_color
end
|
#profile_link_color ⇒ String
17
18
19
|
# File 'lib/twitter/user.rb', line 17
def profile_link_color
@profile_link_color
end
|
17
18
19
|
# File 'lib/twitter/user.rb', line 17
def
@profile_sidebar_border_color
end
|
17
18
19
|
# File 'lib/twitter/user.rb', line 17
def
@profile_sidebar_fill_color
end
|
#profile_text_color ⇒ String
17
18
19
|
# File 'lib/twitter/user.rb', line 17
def profile_text_color
@profile_text_color
end
|
#statuses_count ⇒ Integer
Also known as:
14
15
16
|
# File 'lib/twitter/user.rb', line 14
def statuses_count
@statuses_count
end
|
#time_zone ⇒ String
17
18
19
|
# File 'lib/twitter/user.rb', line 17
def time_zone
@time_zone
end
|
#utc_offset ⇒ Integer
14
15
16
|
# File 'lib/twitter/user.rb', line 14
def utc_offset
@utc_offset
end
|
Instance Method Details
#entities? ⇒ Boolean
75
76
77
|
# File 'lib/twitter/user.rb', line 75
def entities?
!@attrs[:entities].nil? && @attrs[:entities].any? { |_, hash| hash[:urls].any? }
end
|
#uri ⇒ Addressable::URI
Also known as:
url
Returns The URL to the user.
81
82
83
|
# File 'lib/twitter/user.rb', line 81
def uri
Addressable::URI.parse("https://twitter.com/#{screen_name}") if screen_name?
end
|
#website ⇒ Addressable::URI
Returns The URL to the user's website.
88
89
90
91
92
93
94
|
# File 'lib/twitter/user.rb', line 88
def website
if website_uris?
website_uris.first.expanded_url
else
Addressable::URI.parse(@attrs[:url])
end
end
|
#website? ⇒ Boolean
97
98
99
|
# File 'lib/twitter/user.rb', line 97
def website?
!!(website_uris? || @attrs[:url])
end
|