Skip to content

Commit

Permalink
Merge pull request #53 from markedmondson/faraday-deprecation
Browse files Browse the repository at this point in the history
Use updated Faraday syntax
  • Loading branch information
technicalpickles committed Aug 10, 2023
2 parents ce973fe + 1275f51 commit 714e324
Showing 1 changed file with 7 additions and 7 deletions.
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

0 comments on commit 714e324

Please sign in to comment.