Sha256: cfba624ae86d137c7f6bf10c6b587e448e3e03b35917e99a84c3035a3c11d8d0
Contents?: true
Size: 657 Bytes
Versions: 9
Compression:
Stored size: 657 Bytes
Contents
module SocialAvatarProxy module PathHelpers def avatar_base_path @avatar_base_path ||= "" end def avatar_base_path=(path) # strip leading / trailing slashes path = path.gsub(/^\/|\/$/, "") if path.empty? # reset to an empty string @avatar_base_path = "" else # set with prepended slash @avatar_base_path = "/#{path}" end end def twitter_avatar_path(identifier) File.join(avatar_base_path, "twitter", identifier.to_s) end def facebook_avatar_path(identifier) File.join(avatar_base_path, "facebook", identifier.to_s) end end end
Version data entries
9 entries across 9 versions & 1 rubygems