Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert to 1.8's #each_pair method
  • Loading branch information
rmagick committed Jan 20, 2007
1 parent bfd18d9 commit 43c9474
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/rvg/stylable.rb
@@ -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
#++

Expand All @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 43c9474

Please sign in to comment.