Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use updated Faraday syntax #53

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/pager_duty/connection.rb
Expand Up @@ -154,13 +154,13 @@ def initialize(token, token_type: :Token, url: API_PREFIX, debug: false)
@connection = Faraday.new do |conn|
conn.url_prefix = url

token_arg =
case token_type
when :Token then { token: token }
when :Bearer then token
else raise ArgumentError, "invalid token_type: #{token_type.inspect}"
end
conn.authorization(token_type, token_arg)
case token_type
when :Token
conn.request :token_auth, token
when :Bearer
conn.request :authorization, 'Bearer', token
else raise ArgumentError, "invalid token_type: #{token_type.inspect}"
end

conn.use ConvertTimesParametersToISO8601

Expand Down