Class: Safai::Gravatar

Inherits:
Object
  • Object
show all
Defined in:
lib/safai/gravatar.rb

Class Method Summary collapse

Class Method Details

.dp(email, size = 20) ⇒ Object



3
4
5
6
7
# File 'lib/safai/gravatar.rb', line 3

def self.dp(email, size=20)
  email = email.nil? ? "" : email
  identifier = Digest::MD5.hexdigest(email.downcase)
  return "http://gravatar.com/avatar/#{identifier}.png?s=#{size}"    
end

.profile(email) ⇒ Object



9
10
11
12
13
# File 'lib/safai/gravatar.rb', line 9

def self.profile(email)
  email = email.nil? ? "" : email
  identifier = Digest::MD5.hexdigest(email.downcase)
  return "http://gravatar.com/#{identifier}"
end