Permalink
Browse files

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

  • Loading branch information...
1 parent d3306ed commit ebe8f53f0c461e871f8678fd133d60d3537b170f @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 ebe8f53

Please sign in to comment.