Method: Twitter::Profile#profile_image_uri_https

Defined in:
lib/twitter/profile.rb

#profile_image_uri_https(size = :normal) ⇒ URI::Generic Also known as: profile_image_url_https

Returns the secure URL to the user's profile image

Examples:

user.profile_image_uri_https(:normal)

Parameters:

  • size (String, Symbol) (defaults to: :normal)

    The size of the image

Returns:

  • (URI::Generic)


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

def profile_image_uri_https(size = :normal)
  # The profile image URL comes in looking like like this:
  # https://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png
  # It can be converted to any of the following sizes:
  # https://a0.twimg.com/profile_images/1759857427/image1326743606.png
  # https://a0.twimg.com/profile_images/1759857427/image1326743606_mini.png
  # https://a0.twimg.com/profile_images/1759857427/image1326743606_bigger.png
  parse_uri(@attrs[:profile_image_url_https].sub(PROFILE_IMAGE_SUFFIX_REGEX, profile_image_suffix(size))) unless @attrs[:profile_image_url_https].nil? # steep:ignore FallbackAny
end