1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
# -*- coding: utf-8 -*-
=begin rdoc
Model用のmoduleで、これをincludeするとUserに要求されるいくつかのメソッドが定義される。
=end
module Diva::Model::UserMixin
def user
self
end
def icon
Plugin.collect(:photo_filter, profile_image_url, Pluggaloid::COLLECT).map { |photo|
Plugin.filtering(:miracle_icon_filter, photo)[0]
}.first
end
def icon_large
Plugin.collect(:photo_filter, profile_image_url_large, Pluggaloid::COLLECT).lazy.map { |photo|
truth = Plugin.filtering(:miracle_icon_filter, photo)[0]
if photo == truth
truth
else
icon
end
}.first
end
def profile_image_url_large
profile_image_url
end
def verified?
false
end
def protected?
false
end
end
|