26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/mls/region.rb', line 26
def cover_photo_url(options={})
options.reverse_merge!({
:style => nil,
:bg => nil,
:protocol => 'https',
:format => "jpg",
:host => MLS.image_host
});
url_params = { s: options[:style], bg: options[:bg] }.select{ |k, v| v }
if options[:protocol] == :relative
result = '//'
else options[:protocol]
result = "#{options[:protocol]}://"
end
result += "#{options[:host]}/#{cover_photo_digest}.#{options[:format]}"
result += "?#{url_params.to_param}" if url_params.size > 0
result
end
|