mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rss/rss.rb: provided default RSS::Element#children.
* lib/rss/0.9.rb: used default RSS::Element#children. * lib/rss/1.0.rb: ditto. * lib/rss/2.0.rb: ditto. * lib/rss/taxonomy.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
df1e494a13
commit
7625cd5cfb
6 changed files with 20 additions and 71 deletions
|
|
@ -1,3 +1,12 @@
|
|||
Tue Jun 20 21:19:06 2006 Kouhei Sutou <kou@cozmixng.org>
|
||||
|
||||
* lib/rss/rss.rb: provided default RSS::Element#children.
|
||||
|
||||
* lib/rss/0.9.rb: used default RSS::Element#children.
|
||||
* lib/rss/1.0.rb: ditto.
|
||||
* lib/rss/2.0.rb: ditto.
|
||||
* lib/rss/taxonomy.rb: ditto.
|
||||
|
||||
Tue Jun 20 21:04:33 2006 Kouhei Sutou <kou@cozmixng.org>
|
||||
|
||||
* lib/rss/rss.rb: provided default RSS::Element#_tags.
|
||||
|
|
|
|||
|
|
@ -61,10 +61,6 @@ module RSS
|
|||
end
|
||||
|
||||
private
|
||||
def children
|
||||
[@channel]
|
||||
end
|
||||
|
||||
def _attrs
|
||||
[
|
||||
["version", true, "rss_version"],
|
||||
|
|
@ -100,10 +96,6 @@ module RSS
|
|||
alias date= pubDate=
|
||||
|
||||
private
|
||||
def children
|
||||
[@skipDays, @skipHours, @image, @textInput, @cloud, *@item]
|
||||
end
|
||||
|
||||
def maker_target(maker)
|
||||
maker.channel
|
||||
end
|
||||
|
|
@ -137,11 +129,6 @@ module RSS
|
|||
install_have_children_element(name, "", occurs)
|
||||
end
|
||||
|
||||
private
|
||||
def children
|
||||
@day
|
||||
end
|
||||
|
||||
class Day < Element
|
||||
include RSS09
|
||||
|
||||
|
|
@ -169,11 +156,6 @@ module RSS
|
|||
install_have_children_element(name, "", occurs)
|
||||
end
|
||||
|
||||
private
|
||||
def children
|
||||
@hour
|
||||
end
|
||||
|
||||
class Hour < Element
|
||||
include RSS09
|
||||
|
||||
|
|
@ -270,10 +252,6 @@ module RSS
|
|||
end
|
||||
|
||||
private
|
||||
def children
|
||||
[@source, @enclosure, *@category].compact
|
||||
end
|
||||
|
||||
def maker_target(items)
|
||||
if items.respond_to?("items")
|
||||
# For backward compatibility
|
||||
|
|
|
|||
|
|
@ -55,11 +55,6 @@ module RSS
|
|||
tag_name_with_prefix(PREFIX)
|
||||
end
|
||||
|
||||
private
|
||||
def children
|
||||
[@channel, @image, @textinput, *@item]
|
||||
end
|
||||
|
||||
class Li < Element
|
||||
|
||||
include RSS10
|
||||
|
|
@ -125,11 +120,6 @@ module RSS
|
|||
target << li.resource
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def children
|
||||
@li
|
||||
end
|
||||
end
|
||||
|
||||
class Bag < Element
|
||||
|
|
@ -167,11 +157,6 @@ module RSS
|
|||
target << li.resource
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def children
|
||||
@li
|
||||
end
|
||||
end
|
||||
|
||||
class Channel < Element
|
||||
|
|
@ -214,10 +199,6 @@ module RSS
|
|||
end
|
||||
|
||||
private
|
||||
def children
|
||||
[@image, @items, @textinput]
|
||||
end
|
||||
|
||||
def maker_target(maker)
|
||||
maker.channel
|
||||
end
|
||||
|
|
@ -320,11 +301,6 @@ module RSS
|
|||
[]
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def children
|
||||
[@Seq]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -26,12 +26,6 @@ module RSS
|
|||
install_model(name, "", occurs)
|
||||
end
|
||||
|
||||
private
|
||||
alias children09 children
|
||||
def children
|
||||
children09 + @category.compact
|
||||
end
|
||||
|
||||
Category = Item::Category
|
||||
|
||||
class Item
|
||||
|
|
@ -58,11 +52,6 @@ module RSS
|
|||
end
|
||||
|
||||
private
|
||||
alias children09 children
|
||||
def children
|
||||
children09 + [@guid].compact
|
||||
end
|
||||
|
||||
alias _setup_maker_element setup_maker_element
|
||||
def setup_maker_element(item)
|
||||
_setup_maker_element(item)
|
||||
|
|
|
|||
|
|
@ -769,13 +769,20 @@ EOC
|
|||
__send__("#{prefix}#{tag_name}=", next_element)
|
||||
end
|
||||
end
|
||||
|
||||
# not String class children.
|
||||
|
||||
def children
|
||||
[]
|
||||
rv = []
|
||||
self.class.models.each do |name, uri, occurs, getter|
|
||||
value = __send__(getter)
|
||||
next if value.nil?
|
||||
value = [value] unless value.is_a?(Array)
|
||||
value.each do |v|
|
||||
rv << v if v.is_a?(Element)
|
||||
end
|
||||
end
|
||||
rv
|
||||
end
|
||||
|
||||
# default #validate() argument.
|
||||
def _tags
|
||||
rv = []
|
||||
self.class.models.each do |name, uri, occurs, getter|
|
||||
|
|
|
|||
|
|
@ -82,11 +82,6 @@ module RSS
|
|||
[]
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def children
|
||||
[@Bag]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -137,11 +132,6 @@ module RSS
|
|||
def maker_target(target)
|
||||
target.new_taxo_topic
|
||||
end
|
||||
|
||||
private
|
||||
def children
|
||||
[@taxo_link, *@taxo_topics]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue