Source representing a constant URL. Good as a default or last-resort source.
Returns nil if person is nil; the static url otherwise.
# File lib/avatar/source/static_url_source.rb, line 19 def avatar_url_for(person, options = {}) person.nil? ? nil : url end
Create a new source with static url url
.
# File lib/avatar/source/static_url_source.rb, line 13 def initialize(url) raise ArgumentError.new("URL cannot be nil") if url.nil? @url = url.to_s end