Permalink
Browse files

use Hash[] instead of inject({})

  • Loading branch information...
1 parent 6a3aee8 commit 954fa9318101b3c475d21e57a49edb5ea964811e @tpitale tpitale committed Nov 24, 2010
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/garb/report_response.rb
@@ -14,11 +14,9 @@ def results
private
def parse
entries.map do |entry|
- hash = values_for(entry).inject({}) do |h, v|
- h.merge(Garb.from_ga(v['name']) => v['value'])
- end
-
- @instance_klass.new(hash)
+ @instance_klass.new(Hash[
+ values_for(entry).map {|v| [Garb.from_ga(v['name']), v['value']]}
+ ])
end
end

0 comments on commit 954fa93

Please sign in to comment.