mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 23:16:42 +02:00
* lib/rss/rss.rb: RSS::Element#initialize accepts initial
attributes. * lib/rss/0.9.rb: ditto. * lib/rss/1.0.rb: ditto. * lib/rss/2.0.rb: ditto. * lib/rss/dublincore.rb: ditto. * lib/rss/image.rb: ditto. * lib/rss/taxonomy.rb: ditto. * lib/rss/trackback.rb: ditto. * lib/rss/utils.rb: added Utils.element_initialize_arguments? to detect backward compatibility initial arguments. * lib/rss/parser.rb: user initial attributes to initialize RSS::Element. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e6037e6111
commit
63c3fd6aa2
11 changed files with 256 additions and 120 deletions
|
@ -68,9 +68,14 @@ module RSS
|
|||
|
||||
install_must_call_validator('rdf', ::RSS::RDF::URI)
|
||||
|
||||
def initialize(bag=Bag.new)
|
||||
super()
|
||||
@Bag = bag
|
||||
def initialize(*args)
|
||||
if Utils.element_initialize_arguments?(args)
|
||||
super
|
||||
else
|
||||
super()
|
||||
self.Bag = args[0]
|
||||
end
|
||||
self.Bag ||= Bag.new
|
||||
end
|
||||
|
||||
def full_name
|
||||
|
@ -155,9 +160,13 @@ module RSS
|
|||
install_get_attribute("about", ::RSS::RDF::URI, true)
|
||||
install_text_element("#{TAXO_PREFIX}_link")
|
||||
|
||||
def initialize(about=nil)
|
||||
super()
|
||||
@about = about
|
||||
def initialize(*args)
|
||||
if Utils.element_initialize_arguments?(args)
|
||||
super
|
||||
else
|
||||
super()
|
||||
self.about = args[0]
|
||||
end
|
||||
end
|
||||
|
||||
def full_name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue