Refactor GCP Client#user_agent_header to use #tap

This commit is contained in:
Matija Čupić 2017-12-04 13:43:45 +01:00
parent 68b43f4d9c
commit bb80d439f4
No known key found for this signature in database
GPG Key ID: 4BAF84FFACD2E5DE
1 changed files with 3 additions and 3 deletions

View File

@ -84,9 +84,9 @@ module GoogleApi
end
def user_agent_header
options = Google::Apis::RequestOptions.new
options.header = { 'User-Agent': "GitLab/#{Gitlab::VERSION.match('(\d+\.\d+)').captures.first} (GPN:GitLab;)" }
options
Google::Apis::RequestOptions.new.tap do |options|
options.header = { 'User-Agent': "GitLab/#{Gitlab::VERSION.match('(\d+\.\d+)').captures.first} (GPN:GitLab;)" }
end
end
end
end