summaryrefslogtreecommitdiff
path: root/lib/category.rb
blob: 8f14153f55bb2fd2c8d919c399cd2fdda82d0bde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# coding: utf-8
require 'config'

class Category
	def initialize(abbr)
		@abbr = abbr
	end
	def abbr
		@abbr.downcase
	end
	def name
		Config::get.category_name(abbr)
	end
	def html
		return "<a class=\"tag #{abbr}\" href=\"/tags/#{abbr}.html\">#{name}</a>"
	end
	def atom
		return "<category term=\"#{abbr}\" label=\"#{name}\" />"
	end
end