Class: Aardi::TagBlog

Inherits:
Blog show all
Defined in:
lib/aardi/tag_blog.rb

Instance Attribute Summary

Attributes inherited from AbstractBlog

#key

Instance Method Summary collapse

Methods inherited from Blog

#report_recent

Methods inherited from AbstractBlog

#metadata, #mtime, #render, #title

Constructor Details

#initialize(tag) ⇒ TagBlog

:reek:DuplicateMethodCall



6
7
8
9
10
11
# File 'lib/aardi/tag_blog.rb', line 6

def initialize(tag)
  super()
  @tag = tag
  @blog_path = "#{Config[:blog_tags_path]}/#{tag}"
  @archive_path = "#{@blog_path}/#{Config[:blog_archive_path]}"
end

Instance Method Details

#<<(post) ⇒ Object



13
14
15
16
# File 'lib/aardi/tag_blog.rb', line 13

def <<(post)
  @posts << post
  archive << post
end

#countObject



18
19
20
# File 'lib/aardi/tag_blog.rb', line 18

def count
  @posts.count
end

#index_lineObject



22
23
24
# File 'lib/aardi/tag_blog.rb', line 22

def index_line
  "- #{inline_link_text}"
end


26
27
28
# File 'lib/aardi/tag_blog.rb', line 26

def inline_link_text
  "[#{tag}](#{url}) (#{count})"
end

#urlObject



30
31
32
# File 'lib/aardi/tag_blog.rb', line 30

def url
  "#{Config[:site_url]}/#{@blog_path}/"
end