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

- (Object) connections (readonly)

Returns the value of attribute connections



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

def connections
  @connections
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) 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) 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) 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

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) 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

Instance Method Details

- (Boolean) entities?



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

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

- (String) uri Also known as: url



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

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

- (String) website



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

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

- (Boolean) website?



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

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