aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rss/2.0.rb
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-05 07:03:43 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-05 07:03:43 +0000
commit5f3a36794a578eabbc67b401e818b3711051b7ad (patch)
tree2c32372b848d7b2a52c50feb5dc384fc8fe88245 /lib/rss/2.0.rb
parent56ce2994de24b14905f0b23ec35aeb0e3b4ff563 (diff)
downloadruby-5f3a36794a578eabbc67b401e818b3711051b7ad.tar.gz
* lib/rss/*: refactored.
- gave a name to 'x'. - undef_method -> remove_method for avoiding a warning in ruby 1.6. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss/2.0.rb')
-rw-r--r--lib/rss/2.0.rb40
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/rss/2.0.rb b/lib/rss/2.0.rb
index 1ae320f2db..af6ced9f7c 100644
--- a/lib/rss/2.0.rb
+++ b/lib/rss/2.0.rb
@@ -6,9 +6,9 @@ module RSS
class Channel
- %w(generator ttl).each do |x|
- install_text_element(x)
- install_model(x, '?')
+ %w(generator ttl).each do |name|
+ install_text_element(name)
+ install_model(name, '?')
end
remove_method :ttl=
@@ -26,8 +26,8 @@ module RSS
[
["image", "?"],
["language", "?"],
- ].each do |x, occurs|
- install_model(x, occurs)
+ ].each do |name, occurs|
+ install_model(name, occurs)
end
def other_element(need_convert, indent)
@@ -47,8 +47,8 @@ EOT
alias _tags09 _tags
def _tags
- rv = %w(generator ttl).delete_if do |x|
- send(x).nil?
+ rv = %w(generator ttl).delete_if do |name|
+ send(name).nil?
end.collect do |elem|
[nil, elem]
end + _tags09
@@ -67,25 +67,25 @@ EOT
[
["comments", "?"],
["author", "?"],
- ].each do |x, occurs|
- install_text_element(x)
- install_model(x, occurs)
+ ].each do |name, occurs|
+ install_text_element(name)
+ install_model(name, occurs)
end
[
["pubDate", '?'],
- ].each do |x, occurs|
- install_date_element(x, 'rfc822')
- install_model(x, occurs)
+ ].each do |name, occurs|
+ install_date_element(name, 'rfc822')
+ install_model(name, occurs)
end
alias date pubDate
alias date= pubDate=
[
["guid", '?'],
- ].each do |x, occurs|
- install_have_child_element(x)
- install_model(x, occurs)
+ ].each do |name, occurs|
+ install_have_child_element(name)
+ install_model(name, occurs)
end
def other_element(need_convert, indent)
@@ -108,8 +108,8 @@ EOT
alias _tags09 _tags
def _tags
- %w(comments author pubDate guid).delete_if do |x|
- send(x).nil?
+ %w(comments author pubDate guid).delete_if do |name|
+ send(name).nil?
end.collect do |elem|
[nil, elem]
end + _tags09
@@ -162,8 +162,8 @@ EOT
end
- RSS09::ELEMENTS.each do |x|
- BaseListener.install_get_text_element(nil, x, "#{x}=")
+ RSS09::ELEMENTS.each do |name|
+ BaseListener.install_get_text_element(nil, name, "#{name}=")
end
end