Sha256: bd22a6e29d09a17dce60317d6d6197ea1149a9f70c42947fc85db310a8cf9bf3

Contents?: true

Size: 491 Bytes

Versions: 6

Compression:

Stored size: 491 Bytes

Contents

module Integrity
  module Helpers
    module Gravatar
      def gravatar_attrs(author, size=40)
        # size = 40 unless %w(20 30 40 50).include?(size)
        if author.email.nil?
          {:src => "gravatar-#{size}.png", :title => 'Unknown author'}
        else
          email_digest = Digest::MD5.hexdigest(author.email)
          source = "http://gravatar.com/avatar/#{email_digest}?s=#{size}"
          {:src => source, :title => author.name}
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
alphasights-integrity-0.1.9.3 lib/integrity/helpers/gravatar.rb
alphasights-integrity-0.1.9.4 lib/integrity/helpers/gravatar.rb
alphasights-integrity-0.1.9.5 lib/integrity/helpers/gravatar.rb
alphasights-integrity-0.1.9.6 lib/integrity/helpers/gravatar.rb
alphasights-integrity-0.1.9.7 lib/integrity/helpers/gravatar.rb
alphasights-integrity-0.1.9.8 lib/integrity/helpers/gravatar.rb