File: photo.rb

package info (click to toggle)
mikutter 3.5.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 10,256 kB
  • ctags: 2,165
  • sloc: ruby: 19,079; sh: 205; makefile: 20
file content (14 lines) | stat: -rw-r--r-- 423 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# -*- coding: utf-8 -*-
require_relative 'model/photo'
Plugin.create :photo do
  # 第一引数のpermalinkを指すModelを全て取得するフィルタ。
  # このフィルタでは、画像を指すModelしか返ってこない
  defevent :photo_filter,
           prototype: [Object, :<<]

  filter_photo_filter do |permalink, photos|
    photos << Plugin::Photo::Photo[permalink]
    [permalink, photos]
  end
end