Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #658 from kostya/hash_flatten
Hash flatten
  • Loading branch information
alex committed Apr 24, 2013
2 parents f57cc6b + 206e876 commit 616a30b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
7 changes: 7 additions & 0 deletions lib-topaz/hash.rb
Expand Up @@ -211,4 +211,11 @@ def reject(&block)
return enum_for(:reject) unless block
dup.delete_if(&block)
end

def flatten(level = 1)
level = Topaz.convert_type(level, Fixnum, :to_int)
out = []
Topaz::Array.flatten(self, out, level)
out
end
end
9 changes: 0 additions & 9 deletions spec/tags/core/hash/flatten_tags.txt

This file was deleted.

4 changes: 0 additions & 4 deletions spec/tags/language/block_tags.txt
Expand Up @@ -12,10 +12,6 @@ fails:A block taking |a, | arguments assigns the argument the first element of t
fails:A block taking |a, | arguments calls #to_ary to convert a single yielded object to an Array
fails:A block taking |a, | arguments does not call #to_ary if the single yielded object is an Array
fails:A block taking |a, | arguments raises an TypeError if #to_ary does not return an Array
fails:A block taking |(a, b)| arguments destructures a single Array value yielded
fails:A block taking |(a, b)| arguments calls #to_ary to convert a single yielded object to an Array
fails:A block taking |(a, b)| arguments does not call #to_ary if the single yielded object is an Array
fails:A block taking |(a, b)| arguments does not call #to_ary if the object does not respond to #to_ary
fails:A block taking |(a, b)| arguments raises an TypeError if #to_ary does not return an Array
fails:A block taking |(a, b), c| arguments calls #to_ary to convert a single yielded object to an Array
fails:A block taking |(a, b), c| arguments raises an TypeError if #to_ary does not return an Array
Expand Down
2 changes: 0 additions & 2 deletions spec/tags/language/proc_tags.txt
Expand Up @@ -8,6 +8,4 @@ fails:A Proc taking |a, *b| arguments raises an ArgumentError if passed no value
fails:A Proc taking |a, | arguments raises an ArgumentError when passed no values
fails:A Proc taking |a, | arguments raises an ArgumentError when passed more than one value
fails:A Proc taking |(a, b)| arguments raises an ArgumentError when passed no values
fails:A Proc taking |(a, b)| arguments destructures a single Array value yielded
fails:A Proc taking |(a, b)| arguments calls #to_ary to convert a single passed object to an Array
fails:A Proc taking |(a, b)| arguments raises an TypeError if #to_ary does not return an Array

0 comments on commit 616a30b

Please sign in to comment.