Class: Socialoud::Services::Gravatar

Inherits:
Base
  • Object
show all
Defined in:
lib/socialoud/services/gravatar.rb

Instance Attribute Summary

Attributes inherited from Base

#aggregator, #data

Instance Method Summary collapse

Methods inherited from Base

#initialize, #method_missing, #set

Constructor Details

This class inherits a constructor from Socialoud::Services::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Socialoud::Services::Base

Instance Method Details

#emailObject



10
11
12
# File 'lib/socialoud/services/gravatar.rb', line 10

def email
  @data
end

#image(size = 200) ⇒ Object



14
15
16
# File 'lib/socialoud/services/gravatar.rb', line 14

def image(size = 200)
  "http://www.gravatar.com/avatar/#{@hash}?s=#{size}"
end

#profile_urlObject



18
19
20
# File 'lib/socialoud/services/gravatar.rb', line 18

def profile_url
  "http://www.gravatar.com/#{@hash}"
end

#setup!Object



6
7
8
# File 'lib/socialoud/services/gravatar.rb', line 6

def setup!
  @hash = Digest::MD5.hexdigest(@data)
end