module Avataree::Helper
Attributes
secure_url_services[RW]
url_services[RW]
Public Class Methods
included(base)
click to toggle source
# File lib/avataree/helper.rb, line 33 def self.included(base) self.secure_url_services = "https://secure.gravatar.com/" self.url_services = "http://www.gravatar.com/" MonkeyPatches.activate! end
url_for_request(ssl = false)
click to toggle source
# File lib/avataree/helper.rb, line 44 def self.url_for_request(ssl = false) ssl ? self.secure_url_services : self.url_services end
Public Instance Methods
get_params(options)
click to toggle source
# File lib/avataree/helper.rb, line 52 def get_params(options) options.to_param.presence end
make_digest(email)
click to toggle source
makes MD5 hash of given email
# File lib/avataree/helper.rb, line 40 def make_digest(email) Digest::MD5.hexdigest(email) end
prepare_url_with_params(url, options)
click to toggle source
# File lib/avataree/helper.rb, line 48 def prepare_url_with_params(url, options) [url, get_params(options)].compact.join("?") end
to_param()
click to toggle source
# File lib/avataree/helper.rb, line 59 def to_param self.collect{|k,v| "#{k}=#{v}"}.join("&") end