aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rss/syndication.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/syndication.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/syndication.rb')
-rw-r--r--lib/rss/syndication.rb17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/rss/syndication.rb b/lib/rss/syndication.rb
index e71455c6a4..56976085a1 100644
--- a/lib/rss/syndication.rb
+++ b/lib/rss/syndication.rb
@@ -17,12 +17,12 @@ module RSS
super
klass.module_eval(<<-EOC, *get_file_and_line_from_caller(1))
- %w(updatePeriod updateFrequency).each do |x|
- install_text_element("\#{SY_PREFIX}_\#{x}")
+ %w(updatePeriod updateFrequency).each do |name|
+ install_text_element("\#{SY_PREFIX}_\#{name}")
end
- %w(updateBase).each do |x|
- install_date_element("\#{SY_PREFIX}_\#{x}", 'w3cdtf', x)
+ %w(updateBase).each do |name|
+ install_date_element("\#{SY_PREFIX}_\#{name}", 'w3cdtf', name)
end
alias_method(:_sy_updatePeriod=, :sy_updatePeriod=)
@@ -42,8 +42,8 @@ module RSS
def sy_validate(tags)
counter = {}
- ELEMENTS.each do |x|
- counter[x] = 0
+ ELEMENTS.each do |name|
+ counter[name] = 0
end
tags.each do |tag|
@@ -78,8 +78,9 @@ module RSS
prefix_size = SY_PREFIX.size + 1
SyndicationModel::ELEMENTS.uniq!
- SyndicationModel::ELEMENTS.each do |x|
- BaseListener.install_get_text_element(SY_URI, x[prefix_size..-1], "#{x}=")
+ SyndicationModel::ELEMENTS.each do |full_name|
+ name = full_name[prefix_size..-1]
+ BaseListener.install_get_text_element(SY_URI, name, "#{full_name}=")
end
end