2004-01-27 22:46:13 -05:00
|
|
|
# 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
|
2004-03-03 18:08:45 -05:00
|
|
|
attr_writer(*%w(title description creator subject publisher
|
2004-01-27 22:46:13 -05:00
|
|
|
contributor date format identifier source
|
2004-03-03 18:08:45 -05:00
|
|
|
language relation coverage rights).collect{|x| "#{TAXO_PREFIX}_#{x}"})
|
2004-01-27 22:46:13 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
class Channel; extend TaxonomyModel; end
|
|
|
|
class Item; extend TaxonomyModel; end
|
|
|
|
class Image; extend TaxonomyModel; end
|
|
|
|
class TextInput; extend TaxonomyModel; end
|
|
|
|
|
|
|
|
end
|