diff options
| author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-17 00:17:32 +0000 |
|---|---|---|
| committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-17 00:17:32 +0000 |
| commit | a79f93a4731ec59d11137d5265b38cac48fa39f4 (patch) | |
| tree | 92f4dd2d450c0c7573834b76607ce71264ee2f85 /lib | |
| parent | 089af4800ad73c202a82af46d15a5a9060c759af (diff) | |
| download | ruby-a79f93a4731ec59d11137d5265b38cac48fa39f4.tar.gz ruby-a79f93a4731ec59d11137d5265b38cac48fa39f4.tar.xz ruby-a79f93a4731ec59d11137d5265b38cac48fa39f4.zip | |
* lib/rss, test/rss: backported from trunk. (2005-11-16 - now)
* lib/rss/1.0.rb: added convenience method 'resources'.
* lib/rss/taxonomy.rb: ditto.
* test/rss/rss-assertions.rb: added test for 'resources'.
* test/rss/test_taxonomy.rb: ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/rss/1.0.rb | 13 | ||||
| -rw-r--r-- | lib/rss/taxonomy.rb | 10 |
2 files changed, 20 insertions, 3 deletions
diff --git a/lib/rss/1.0.rb b/lib/rss/1.0.rb index be3ff7d41..5c7e3f5e6 100644 --- a/lib/rss/1.0.rb +++ b/lib/rss/1.0.rb @@ -438,12 +438,21 @@ module RSS end end + def resources + if @Seq + @Seq.lis.collect do |li| + li.resource + end + else + [] + end + end + private def children [@Seq] end - private def _tags rv = [] rv << [URI, 'Seq'] unless @Seq.nil? @@ -453,9 +462,7 @@ module RSS def rdf_validate(tags) _validate(tags, [["Seq", nil]]) end - end - end class Image < Element diff --git a/lib/rss/taxonomy.rb b/lib/rss/taxonomy.rb index d7a5b6d19..c89de64d3 100644 --- a/lib/rss/taxonomy.rb +++ b/lib/rss/taxonomy.rb @@ -86,6 +86,16 @@ module RSS end end + def resources + if @Bag + @Bag.lis.collect do |li| + li.resource + end + else + [] + end + end + private def children [@Bag] |
