summaryrefslogtreecommitdiff
path: root/lib/rss/taxonomy.rb
diff options
context:
space:
mode:
author(no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-06 08:02:56 +0000
committer(no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-06 08:02:56 +0000
commit5923a2c0e770515a9c7144c50e09a32350695b00 (patch)
tree66882c2ac60d7d1b25bb49ee476cb829695aa906 /lib/rss/taxonomy.rb
parent8e773df6d3b68caf2e56e6c75a8e48bf2ccc1bd3 (diff)
This commit was manufactured by cvs2svn to create branch 'ruby_1_8'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss/taxonomy.rb')
-rw-r--r--lib/rss/taxonomy.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/rss/taxonomy.rb b/lib/rss/taxonomy.rb
new file mode 100644
index 0000000000..5b11d338e0
--- /dev/null
+++ b/lib/rss/taxonomy.rb
@@ -0,0 +1,32 @@
+# Experimental
+
+require "rss/1.0"
+
+module RSS
+
+ TAXO_PREFIX = "taxo"
+ TAXO_NS = "http://purl.org/rss/1.0/modules/taxonomy/"
+
+ Element.install_ns(TAXO_PREFIX, TAXO_NS)
+
+ TAXO_ELEMENTS = []
+
+ %w(link).each do |x|
+ if const_defined? :Listener
+ Listener.install_get_text_element(x, TAXO_NS, "#{TAXO_PREFIX}_#{x}=")
+ end
+ TAXO_ELEMENTS << "#{TAXO_PREFIX}_#{x}"
+ end
+
+ module TaxonomyModel
+ attr_writer(*%w(title description creator subject publisher
+ contributor date format identifier source
+ language relation coverage rights).collect{|x| "#{TAXO_PREFIX}_#{x}"})
+ end
+
+ class Channel; extend TaxonomyModel; end
+ class Item; extend TaxonomyModel; end
+ class Image; extend TaxonomyModel; end
+ class TextInput; extend TaxonomyModel; end
+
+end