1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rss/maker.rb, lib/rss/maker/0.9.rb, lib/rss/maker/base.rb:

RSS::Maker.[] returns a maker class corresponds to passed version.

* test/rss/test_maker_*.rb: add tests for RSS::Maker.[].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kou 2008-12-11 12:08:20 +00:00
parent 1312189505
commit dd5a95a14c
9 changed files with 86 additions and 13 deletions

View file

@ -6,14 +6,13 @@ module RSS
class << self
def make(version, &block)
maker_info = self[version]
maker_info[:maker].make(maker_info[:version], &block)
self[version].make(&block)
end
def [](version)
maker_info = maker(version)
raise UnsupportedMakerVersionError.new(version) if maker_info.nil?
maker_info
maker_info[:maker]
end
def add_maker(version, normalized_version, maker)