Permalink
Browse files

Clean up the header inject to use |hash, (header, value)|

  • Loading branch information...
1 parent bcf9378 commit 4c76c40d61fde428bd012b3e559f6212b6d9e76b @oestrich oestrich committed Aug 24, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/rspec_api_documentation/dsl/endpoint.rb
@@ -63,11 +63,11 @@ def params
def headers
return unless example.metadata[:headers]
- example.metadata[:headers].inject({}) do |hash, header|
- if header[1].is_a?(Symbol)
- hash[header[0]] = send(header[1]) if respond_to?(header[1])
+ example.metadata[:headers].inject({}) do |hash, (header, value)|
+ if value.is_a?(Symbol)
+ hash[header] = send(value) if respond_to?(value)
else
- hash[header[0]] = header[1]
+ hash[header] = value
end
hash
end

0 comments on commit 4c76c40

Please sign in to comment.