Sha256: c39d055d046be2b2cd389e7a1a145ba139a6e6c81a5d0aee662ebf9579a0c106
Contents?: true
Size: 1.02 KB
Versions: 3
Compression:
Stored size: 1.02 KB
Contents
$:.unshift File.expand_path(File.dirname(__FILE__)) require 'avatar/source/abstract_source' require 'avatar/source/gravatar_source' require 'avatar/source/pavatar_source' # Helpers for displaying avatars. # Usage in Rails: # # in app/helpers/ProfileHelper.rb: # include Avatar::ActionView::Support # # # in app/views/profiles/show.html.erb: # <%= avatar_for @person => current_person %> # # By default, Avatar::source is a GravatarSource module Avatar @@source = Avatar::Source::GravatarSource.new @@default_avatar_options = {} def self.source @@source.dup end def self.source=(source) raise ArgumentError.new("#{source} is not an Avatar::Source::AbstractSource") unless source.kind_of?(Avatar::Source::AbstractSource) @@source = source end def self.default_avatar_options @@default_avatar_options.dup end def self.default_avatar_options=(options) raise ArgumentError.new("#{options} is not a Hash") unless options.kind_of?(Hash) @@default_avatar_options = options end end
Version data entries
3 entries across 3 versions & 3 rubygems
Version | Path |
---|---|
gcnovus-avatar-0.2.0 | lib/avatar.rb |
krasivotokak-avatar-0.0.7 | lib/avatar.rb |
avatar-0.2.0 | lib/avatar.rb |