summaryrefslogtreecommitdiff
path: root/lib/category.rb
blob: e0ed8e0fa1d1fa9718aa749f65aaf35058016c4e (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