Class: BookRanking

Inherits:
Mustache
  • Object
show all
Defined in:
lib/zine_brewer/templates/bookranking.rb

Instance Method Summary collapse

Instance Method Details

#coverObject



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/zine_brewer/templates/bookranking.rb', line 25

def cover
  case File.dirname(src)
  when ".", "images"
    f = File.basename(src)
    "/static/images/article/■記事ID■/#{/^\d+_/ =~ f ? f : '■記事ID■_' + f}"
  when "common"
    "/static/images/article/common/#{File.basename(src)}"
  else
    src
  end
end

#descriptionObject



21
22
23
# File 'lib/zine_brewer/templates/bookranking.rb', line 21

def description
  Mustache.new.render(desc, {book: "『[#{title}](#{url})』"})
end