Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 4c76c40d61fde428bd012b3e559f6212b6d9e76b 1 parent bcf9378
@oestrich oestrich authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/rspec_api_documentation/dsl/endpoint.rb
View
8 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
Please sign in to comment.
Something went wrong with that request. Please try again.