diff options
| author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-05 07:03:43 +0000 |
|---|---|---|
| committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-05 07:03:43 +0000 |
| commit | c6c85176d5a14557e083fa047022dd6ed062a7d6 (patch) | |
| tree | 2c32372b848d7b2a52c50feb5dc384fc8fe88245 /lib/rss/syndication.rb | |
| parent | 58b4eda65c7f3ef00237314b25a5ae962f326823 (diff) | |
| download | ruby-c6c85176d5a14557e083fa047022dd6ed062a7d6.tar.gz ruby-c6c85176d5a14557e083fa047022dd6ed062a7d6.tar.xz ruby-c6c85176d5a14557e083fa047022dd6ed062a7d6.zip | |
* lib/rss/*: refactored.
- gave a name to 'x'.
- undef_method -> remove_method for avoiding a warning in ruby 1.6.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss/syndication.rb')
| -rw-r--r-- | lib/rss/syndication.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/rss/syndication.rb b/lib/rss/syndication.rb index e71455c6a..56976085a 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 |
