summaryrefslogtreecommitdiff
path: root/lib/tag.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tag.rb')
-rw-r--r--lib/tag.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/tag.rb b/lib/tag.rb
new file mode 100644
index 0000000..4009f67
--- /dev/null
+++ b/lib/tag.rb
@@ -0,0 +1,17 @@
+# coding: utf-8
+require 'config'
+
+class Tag
+ def initialize(abbr)
+ @abbr = abbr
+ end
+ def abbr
+ @abbr
+ end
+ def name
+ Config::get.tag_name(@abbr)
+ end
+ def html
+ return "<a class=\"tag #{abbr}\" href=\"/tags/#{abbr}.html\">#{name}</a>"
+ end
+end