Permalink
Browse files

Revert to 1.8's #each_pair method

  • Loading branch information...
1 parent bfd18d9 commit 43c94740cee70cf8b346e6bd398fb0b573fb710c rmagick committed Jan 20, 2007
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/rvg/stylable.rb
View
@@ -1,5 +1,5 @@
#--
-# $Id: stylable.rb,v 1.3 2007/01/20 17:39:50 rmagick Exp $
+# $Id: stylable.rb,v 1.4 2007/01/20 17:49:57 rmagick Exp $
# Copyright (C) 2007 Timothy P. Hunter
#++
@@ -22,7 +22,7 @@ class Styles
def set(styles)
begin
- styles.each do |style, value|
+ styles.each_pair do |style, value|
begin
self[style] = value
rescue NoMethodError
@@ -37,15 +37,15 @@ def set(styles)
# Iterate over the style names. Yield for each style that has a value.
def each_value
- each do |style, value|
+ each_pair do |style, value|
yield(style, value) if value
end
end
# The "usual" deep_copy method doesn't copy a Struct correctly.
def deep_copy(h=nil)
copy = Styles.new
- each { |style, value| copy[style] = value }
+ each_pair { |style, value| copy[style] = value }
return copy
end

0 comments on commit 43c9474

Please sign in to comment.