Skip to content
Permalink
Browse files

added Hash#to_a

  • Loading branch information
Alex Gaynor
Alex Gaynor committed Apr 9, 2013
1 parent 21cc3d0 commit 9c3e2d726b6234e36aca5f28ad21bb88809299cb
Showing with 8 additions and 1 deletion.
  1. +8 −0 lib-topaz/hash.rb
  2. +0 −1 spec/tags/core/hash/to_a_tags.txt
@@ -23,6 +23,14 @@ def each_value(&block)
each { |k, v| yield v }
end

def to_a
res = []
each do |k, v|
res << [k, v]
end
res
end

def ==(other)
if self.equal?(other)
return true
@@ -1,2 +1 @@
fails:Hash#to_a returns a list of [key, value] pairs with same order as each()
fails:Hash#to_a is called for Enumerable#entries

0 comments on commit 9c3e2d7

Please sign in to comment.
You can’t perform that action at this time.