Module: Gravtastic::InstanceMethods
- Defined in:
- lib/gravtastic.rb
Instance Method Summary collapse
-
#gravatar_id ⇒ Object
The raw MD5 hash of the users' email.
-
#gravatar_url(options = {}) ⇒ Object
Constructs the full Gravatar url.
Instance Method Details
#gravatar_id ⇒ Object
The raw MD5 hash of the users' email. Gravatar is particularly tricky as it downcases all emails. This is really the guts of the module, everything else is just convenience.
77 78 79 |
# File 'lib/gravtastic.rb', line 77 def gravatar_id Digest::MD5.hexdigest(send(self.class.gravatar_source).to_s.downcase) end |
#gravatar_url(options = {}) ⇒ Object
Constructs the full Gravatar url.
82 83 84 85 86 87 |
# File 'lib/gravtastic.rb', line 82 def gravatar_url(={}) = self.class.gravatar_defaults.merge() gravatar_hostname(.delete(:secure)) + gravatar_filename(.delete(:filetype)) + url_params_from_hash() end |