Skip to content

Commit 4c76c40

Browse files
committed
Clean up the header inject to use |hash, (header, value)|
1 parent bcf9378 commit 4c76c40

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/rspec_api_documentation/dsl/endpoint.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ def params
6363

6464
def headers
6565
return unless example.metadata[:headers]
66-
example.metadata[:headers].inject({}) do |hash, header|
67-
if header[1].is_a?(Symbol)
68-
hash[header[0]] = send(header[1]) if respond_to?(header[1])
66+
example.metadata[:headers].inject({}) do |hash, (header, value)|
67+
if value.is_a?(Symbol)
68+
hash[header] = send(value) if respond_to?(value)
6969
else
70-
hash[header[0]] = header[1]
70+
hash[header] = value
7171
end
7272
hash
7373
end

0 commit comments

Comments
 (0)