lib/twitter/profile.rb in twitter-7.0.0 vs lib/twitter/profile.rb in twitter-8.0.0.rc.1
- old
+ new
@@ -1,13 +1,13 @@
-require 'addressable/uri'
-require 'cgi'
-require 'memoizable'
+require "addressable/uri"
+require "cgi"
+require "memoizable"
module Twitter
module Profile
- PROFILE_IMAGE_SUFFIX_REGEX = /_normal(\.gif|\.jpe?g|\.png)$/i.freeze
- PREDICATE_URI_METHOD_REGEX = /_uri\?$/.freeze
+ PROFILE_IMAGE_SUFFIX_REGEX = /_normal(\.gif|\.jpe?g|\.png)$/i
+ PREDICATE_URI_METHOD_REGEX = /_uri\?$/
include Memoizable
class << self
private
@@ -25,20 +25,20 @@
# Return the URL to the user's profile banner image
#
# @param size [String, Symbol] The size of the image. Must be one of: 'mobile', 'mobile_retina', 'web', 'web_retina', 'ipad', or 'ipad_retina'
# @return [Addressable::URI]
def profile_banner_uri(size = :web)
- parse_uri(insecure_uri([@attrs[:profile_banner_url], size].join('/'))) unless @attrs[:profile_banner_url].nil?
+ parse_uri(insecure_uri([@attrs[:profile_banner_url], size].join("/"))) unless @attrs[:profile_banner_url].nil?
end
alias profile_banner_url profile_banner_uri
# Return the secure URL to the user's profile banner image
#
# @param size [String, Symbol] The size of the image. Must be one of: 'mobile', 'mobile_retina', 'web', 'web_retina', 'ipad', or 'ipad_retina'
# @return [Addressable::URI]
def profile_banner_uri_https(size = :web)
- parse_uri([@attrs[:profile_banner_url], size].join('/')) unless @attrs[:profile_banner_url].nil?
+ parse_uri([@attrs[:profile_banner_url], size].join("/")) unless @attrs[:profile_banner_url].nil?
end
alias profile_banner_url_https profile_banner_uri_https
# @return [Boolean]
def profile_banner_uri?
@@ -83,10 +83,10 @@
def parse_uri(uri)
Addressable::URI.parse(uri)
end
def insecure_uri(uri)
- uri.to_s.sub(/^https/i, 'http')
+ uri.to_s.sub(/^https/i, "http")
end
def profile_image_suffix(size)
size.to_sym == :original ? '\\1' : "_#{size}\\1"
end