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

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

Methods included from Utils

flat_pmap, pmap, pmap_with_index

Constructor Details

This class inherits a constructor from Twitter::Identity

Instance Attribute Details

- (Object) connections (readonly)

Returns the value of attribute connections



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

def connections
  @connections
end

- (Object) contributors_enabled (readonly)

Returns the value of attribute contributors_enabled



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

def contributors_enabled
  @contributors_enabled
end

- (Object) default_profile (readonly)

Returns the value of attribute default_profile



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

def default_profile
  @default_profile
end

- (Object) default_profile_image (readonly)

Returns the value of attribute default_profile_image



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

def default_profile_image
  @default_profile_image
end

- (Object) description (readonly)

Returns the value of attribute description



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

def description
  @description
end

- (Object) favourites_count (readonly) Also known as: favorites_count

Returns the value of attribute favourites_count



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

def favourites_count
  @favourites_count
end

- (Object) follow_request_sent (readonly)

Returns the value of attribute follow_request_sent



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

def follow_request_sent
  @follow_request_sent
end

- (Object) followers_count (readonly)

Returns the value of attribute followers_count



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

def followers_count
  @followers_count
end

- (Object) friends_count (readonly)

Returns the value of attribute friends_count



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

def friends_count
  @friends_count
end

- (Object) geo_enabled (readonly)

Returns the value of attribute geo_enabled



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

def geo_enabled
  @geo_enabled
end

- (Object) is_translator (readonly) Also known as: translator?

Returns the value of attribute is_translator



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

def is_translator
  @is_translator
end

- (Object) lang (readonly)

Returns the value of attribute lang



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

def lang
  @lang
end

- (Object) listed_count (readonly)

Returns the value of attribute listed_count



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

def listed_count
  @listed_count
end

- (Object) location (readonly)

Returns the value of attribute location



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

def location
  @location
end

- (Object) name (readonly)

Returns the value of attribute name



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

def name
  @name
end

- (Object) notifications (readonly)

Returns the value of attribute notifications



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

def notifications
  @notifications
end

- (Object) profile_background_color (readonly)

Returns the value of attribute profile_background_color



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

def profile_background_color
  @profile_background_color
end

- (Object) profile_background_image_url (readonly) Also known as: profile_background_image_uri

Returns the value of attribute profile_background_image_url



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

def profile_background_image_url
  @profile_background_image_url
end

- (Object) profile_background_image_url_https (readonly) Also known as: profile_background_image_uri_https

Returns the value of attribute profile_background_image_url_https



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

def profile_background_image_url_https
  @profile_background_image_url_https
end

- (Object) profile_background_tile (readonly)

Returns the value of attribute profile_background_tile



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

def profile_background_tile
  @profile_background_tile
end

Returns the value of attribute profile_link_color



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

def profile_link_color
  @profile_link_color
end

- (Object) profile_sidebar_border_color (readonly)

Returns the value of attribute profile_sidebar_border_color



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

def profile_sidebar_border_color
  @profile_sidebar_border_color
end

- (Object) profile_sidebar_fill_color (readonly)

Returns the value of attribute profile_sidebar_fill_color



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

def profile_sidebar_fill_color
  @profile_sidebar_fill_color
end

- (Object) profile_text_color (readonly)

Returns the value of attribute profile_text_color



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

def profile_text_color
  @profile_text_color
end

- (Object) profile_use_background_image (readonly)

Returns the value of attribute profile_use_background_image



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

def profile_use_background_image
  @profile_use_background_image
end

- (Object) protected (readonly)

Returns the value of attribute protected



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

def protected
  @protected
end

- (Object) statuses_count (readonly) Also known as: tweets_count

Returns the value of attribute statuses_count



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

def statuses_count
  @statuses_count
end

- (Object) time_zone (readonly)

Returns the value of attribute time_zone



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

def time_zone
  @time_zone
end

- (Object) utc_offset (readonly)

Returns the value of attribute utc_offset



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

def utc_offset
  @utc_offset
end

- (Object) verified (readonly)

Returns the value of attribute verified



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

def verified
  @verified
end

Instance Method Details

- (Array<Twitter::Entity::URI>) description_uris Also known as: description_urls

Returns:



36
37
38
39
40
# File 'lib/twitter/user.rb', line 36

def description_uris
  Array(@attrs[:entities][:description][:urls]).collect do |entity|
    Entity::URI.new(entity)
  end
end

- (String) uri Also known as: url

Returns The URL to the user.

Returns:

  • (String)

    The URL to the user.



45
46
47
# File 'lib/twitter/user.rb', line 45

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

- (String) website

Returns The URL to the user's website.

Returns:

  • (String)

    The URL to the user's website.



52
53
54
# File 'lib/twitter/user.rb', line 52

def website
  Addressable::URI.parse(@attrs[:url]) unless @attrs[:url].nil?
end

- (Boolean) website?

Returns:

  • (Boolean)


57
58
59
# File 'lib/twitter/user.rb', line 57

def website?
  !!@attrs[:url]
end