Module: MLS::Avatar
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/mls.rb
Instance Method Summary collapse
Instance Method Details
#avatar_url(options = {}) ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/mls.rb', line 60 def avatar_url(={}) .reverse_merge!({ :style => nil, :protocol => "http", :bg => nil, :format => "jpg" }); url_params = {s: [:style], bg: [:bg]}.select{ |k, v| v } result = "#{[:protocol]}://#{MLS.image_host}/#{avatar_digest}.#{[:format]}" result += "?#{url_params.to_param}" if url_params.size > 0 result end |