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/content.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/content.rb')
| -rw-r--r-- | lib/rss/content.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/rss/content.rb b/lib/rss/content.rb index 78eefadff..a732cec97 100644 --- a/lib/rss/content.rb +++ b/lib/rss/content.rb @@ -17,16 +17,16 @@ module RSS super klass.module_eval(<<-EOC, *get_file_and_line_from_caller(1)) - %w(encoded).each do |x| - install_text_element("\#{CONTENT_PREFIX}_\#{x}") + %w(encoded).each do |name| + install_text_element("\#{CONTENT_PREFIX}_\#{name}") end EOC end def content_validate(tags) counter = {} - ELEMENTS.each do |x| - counter[x] = 0 + ELEMENTS.each do |name| + counter[name] = 0 end tags.each do |tag| @@ -45,8 +45,9 @@ module RSS prefix_size = CONTENT_PREFIX.size + 1 ContentModel::ELEMENTS.uniq! - ContentModel::ELEMENTS.each do |x| - BaseListener.install_get_text_element(CONTENT_URI, x[prefix_size..-1], "#{x}=") + ContentModel::ELEMENTS.each do |full_name| + name = full_name[prefix_size..-1] + BaseListener.install_get_text_element(CONTENT_URI, name, "#{full_name}=") end end |
