Permalink
Browse files

simpler, dry implementation for HeaderHash#to_hash, fixes #177

  • Loading branch information...
1 parent b82e4f0 commit d0e8aedb18a830356e4a624cf6ea36ca303a7f41 @rkh rkh committed Jun 16, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/rack/utils.rb
View
@@ -351,9 +351,9 @@ def each
end
def to_hash
- Hash[*map do |k, v|
- [k, v.respond_to?(:to_ary) ? v.to_ary.join("\n") : v]
- end.flatten]
+ hash = {}
+ each { |k,v| hash[k] = v }
+ hash
end
def [](k)

0 comments on commit d0e8aed

Please sign in to comment.