summaryrefslogtreecommitdiff
path: root/lib/rinda
diff options
context:
space:
mode:
authorseki <seki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-16 05:43:19 +0000
committerseki <seki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-16 05:43:19 +0000
commit898f094d8dc58ceafb1329784cc5c2c01f12f710 (patch)
tree94cf98d22e19e7484a25c65b769f683ee645e671 /lib/rinda
parent6de9ca76512b616df2575c83dd11ea472a10755b (diff)
check remote hash tuple
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rinda')
-rw-r--r--lib/rinda/rinda.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rinda/rinda.rb b/lib/rinda/rinda.rb
index 50fb846..5af8ecb 100644
--- a/lib/rinda/rinda.rb
+++ b/lib/rinda/rinda.rb
@@ -31,7 +31,7 @@ module Rinda
class Tuple
# Initialize a tuple with an Array or a Hash.
def initialize(ary_or_hash)
- if Hash === ary_or_hash
+ if hash?(ary_or_hash)
init_with_hash(ary_or_hash)
else
init_with_ary(ary_or_hash)
@@ -68,6 +68,10 @@ module Rinda
end
private
+ def hash?(ary_or_hash)
+ ary_or_hash.respond_to?(:keys)
+ end
+
def init_with_ary(ary)
@tuple = Array.new(ary.size)
@tuple.size.times do |i|