summaryrefslogtreecommitdiff
path: root/lib/category.rb
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-01-06 23:18:24 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-01-06 23:18:24 -0500
commit4a3a404a5cb2a8d5be83e28cec5c539928fa30f4 (patch)
treeb6f636ba3ed0ce486941b1b9ad67cb0973699d6b /lib/category.rb
parent7edb003cd1c9b53ffdff11ef85532e39f08db16d (diff)
aaaah
Diffstat (limited to 'lib/category.rb')
-rw-r--r--lib/category.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/category.rb b/lib/category.rb
new file mode 100644
index 0000000..266da34
--- /dev/null
+++ b/lib/category.rb
@@ -0,0 +1,20 @@
+# coding: utf-8
+require 'config'
+
+class Category
+ def initialize(abbr)
+ @abbr = abbr
+ end
+ def abbr
+ @abbr
+ 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=\"#{term}\" label=\"#{name}\" />"
+ end
+end