mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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:
parent
820c409ce9
commit
1e5fbe04f6
2 changed files with 17 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue