OSDN Git Service

ruby-1.9.1-rc1
[splhack/AndroidRuby.git] / lib / ruby-1.9.1-rc1 / lib / rss / content.rb
1 require "rss/rss"
2
3 module RSS
4   CONTENT_PREFIX = 'content'
5   CONTENT_URI = "http://purl.org/rss/1.0/modules/content/"
6
7   module ContentModel
8     extend BaseModel
9
10     ELEMENTS = ["#{CONTENT_PREFIX}_encoded"]
11
12     def self.append_features(klass)
13       super
14
15       klass.install_must_call_validator(CONTENT_PREFIX, CONTENT_URI)
16       ELEMENTS.each do |full_name|
17         name = full_name[(CONTENT_PREFIX.size + 1)..-1]
18         klass.install_text_element(name, CONTENT_URI, "?", full_name)
19       end
20     end
21   end
22
23   prefix_size = CONTENT_PREFIX.size + 1
24   ContentModel::ELEMENTS.each do |full_name|
25     name = full_name[prefix_size..-1]
26     BaseListener.install_get_text_element(CONTENT_URI, name, full_name)
27   end
28 end
29
30 require 'rss/content/1.0'
31 require 'rss/content/2.0'