Class: Aardi::TagBlog
Instance Attribute Summary
Attributes inherited from AbstractBlog
#key
Instance Method Summary
collapse
Methods inherited from Blog
#report_recent
#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
|
#count ⇒ Object
18
19
20
|
# File 'lib/aardi/tag_blog.rb', line 18
def count
@posts.count
end
|
#index_line ⇒ Object
22
23
24
|
# File 'lib/aardi/tag_blog.rb', line 22
def index_line
"- #{inline_link_text}"
end
|
#inline_link_text ⇒ Object
26
27
28
|
# File 'lib/aardi/tag_blog.rb', line 26
def inline_link_text
"[#{tag}](#{url}) (#{count})"
end
|
#url ⇒ Object
30
31
32
|
# File 'lib/aardi/tag_blog.rb', line 30
def url
"#{Config[:site_url]}/#{@blog_path}/"
end
|