Class: Twitter::User

Inherits:
BasicUser show all
Includes:
Memoizable, Creatable, Profile
Defined in:
lib/twitter/user.rb

Constant Summary

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, deprecate_attribute_method, display_uri_attr_reader, #initialize, object_attr_reader, predicate_attr_reader, uri_attr_reader

Methods included from Utils

flat_pmap, pmap

Constructor Details

This class inherits a constructor from Twitter::Identity

Instance Attribute Details

#connectionsArray (readonly)



14
15
16
# File 'lib/twitter/user.rb', line 14

def connections
  @connections
end

#descriptionString (readonly)



19
20
21
# File 'lib/twitter/user.rb', line 19

def description
  @description
end

#favourites_countInteger (readonly) Also known as: favorites_count



16
17
18
# File 'lib/twitter/user.rb', line 16

def favourites_count
  @favourites_count
end

#followers_countInteger (readonly)



16
17
18
# File 'lib/twitter/user.rb', line 16

def followers_count
  @followers_count
end

#friends_countInteger (readonly)



16
17
18
# File 'lib/twitter/user.rb', line 16

def friends_count
  @friends_count
end

#langString (readonly)



19
20
21
# File 'lib/twitter/user.rb', line 19

def lang
  @lang
end

#listed_countInteger (readonly)



16
17
18
# File 'lib/twitter/user.rb', line 16

def listed_count
  @listed_count
end

#locationString (readonly)



19
20
21
# File 'lib/twitter/user.rb', line 19

def location
  @location
end

#nameString (readonly)



19
20
21
# File 'lib/twitter/user.rb', line 19

def name
  @name
end

#profile_background_colorString (readonly)



19
20
21
# File 'lib/twitter/user.rb', line 19

def profile_background_color
  @profile_background_color
end


19
20
21
# File 'lib/twitter/user.rb', line 19

def profile_link_color
  @profile_link_color
end

#profile_sidebar_border_colorString (readonly)



19
20
21
# File 'lib/twitter/user.rb', line 19

def profile_sidebar_border_color
  @profile_sidebar_border_color
end

#profile_sidebar_fill_colorString (readonly)



19
20
21
# File 'lib/twitter/user.rb', line 19

def profile_sidebar_fill_color
  @profile_sidebar_fill_color
end

#profile_text_colorString (readonly)



19
20
21
# File 'lib/twitter/user.rb', line 19

def profile_text_color
  @profile_text_color
end

#statuses_countInteger (readonly) Also known as: tweets_count



16
17
18
# File 'lib/twitter/user.rb', line 16

def statuses_count
  @statuses_count
end

#time_zoneString (readonly)



19
20
21
# File 'lib/twitter/user.rb', line 19

def time_zone
  @time_zone
end

#utc_offsetInteger (readonly)



16
17
18
# File 'lib/twitter/user.rb', line 16

def utc_offset
  @utc_offset
end

Instance Method Details

#entities?Boolean



77
78
79
# File 'lib/twitter/user.rb', line 77

def entities?
  !@attrs[:entities].nil? && @attrs[:entities].any? { |_, hash| hash[:urls].any? }
end

#uriAddressable::URI Also known as: url



83
84
85
# File 'lib/twitter/user.rb', line 83

def uri
  Addressable::URI.parse("https://twitter.com/#{screen_name}") if screen_name?
end

#websiteAddressable::URI



90
91
92
93
94
95
96
# File 'lib/twitter/user.rb', line 90

def website
  if website_uris?
    website_uris.first.expanded_url
  else
    Addressable::URI.parse(@attrs[:url])
  end
end

#website?Boolean



99
100
101
# File 'lib/twitter/user.rb', line 99

def website?
  !!(website_uris? || @attrs[:url])
end