* lib/rss/maker.rb (RSS::Maker.[]): add.

Suggested by Akinori MUSHA. Thanks!!! [ruby-dev:37210]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kou 2008-12-10 12:34:09 +00:00
Родитель 820c409ce9
Коммит 1e5fbe04f6
2 изменённых файлов: 17 добавлений и 5 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Wed Dec 10 21:32:02 2008 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/maker.rb (RSS::Maker.[]): add.
Suggested by Akinori MUSHA. Thanks!!! [ruby-dev:37210]
Wed Dec 10 12:56:32 2008 Akinori MUSHA <knu@iDaemons.org>
* enumerator.c (enumerator_rewind): If the enclosed object

Просмотреть файл

@ -6,13 +6,14 @@ module RSS
class << self
def make(version, &block)
m = maker(version)
raise UnsupportedMakerVersionError.new(version) if m.nil?
m[:maker].make(m[:version], &block)
maker_info = self[version]
maker_info[:maker].make(maker_info[:version], &block)
end
def maker(version)
MAKERS[version]
def [](version)
maker_info = maker(version)
raise UnsupportedMakerVersionError.new(version) if maker_info.nil?
maker_info
end
def add_maker(version, normalized_version, maker)
@ -26,6 +27,12 @@ module RSS
def makers
MAKERS.values.collect {|info| info[:maker]}.uniq
end
private
# Can I remove this method?
def maker(version)
MAKERS[version]
end
end
end
end