# coding: utf-8 require 'mustache' class BookRanking < Mustache # <> # url: AmazonのURL # title: 書名 # src: 書影ファイル名 # desc: 説明 @template = <
{{title}}

 {{& description}}

EOT def description Mustache.new.render(desc, {book: "『[#{title}](#{url})』"}) end def cover case File.dirname(src) when ".", "images" "/static/images/article/■記事ID■/#{File.basename(src)}" when "common" "/static/images/article/common/#{File.basename(src)}" else src end end end