@@ -72,13 +72,16 @@ def initialize(client_id, client_secret, options = {}, &block)
7272
7373 # Set the site host
7474 #
75- # @param value [String] the OAuth2 provider site host
75+ # @param [String] value the OAuth2 provider site host
76+ # @return [String] the site host value
7677 def site = ( value )
7778 @connection = nil
7879 @site = value
7980 end
8081
8182 # The Faraday connection object
83+ #
84+ # @return [Faraday::Connection] the initialized Faraday connection
8285 def connection
8386 @connection ||=
8487 Faraday . new ( site , options [ :connection_opts ] ) do |builder |
@@ -95,32 +98,36 @@ def connection
9598 # The authorize endpoint URL of the OAuth2 provider
9699 #
97100 # @param [Hash] params additional query parameters
101+ # @return [String] the constructed authorize URL
98102 def authorize_url ( params = { } )
99103 params = ( params || { } ) . merge ( redirection_params )
100104 connection . build_url ( options [ :authorize_url ] , params ) . to_s
101105 end
102106
103107 # The token endpoint URL of the OAuth2 provider
104108 #
105- # @param [Hash] params additional query parameters
109+ # @param [Hash, nil] params additional query parameters
110+ # @return [String] the constructed token URL
106111 def token_url ( params = nil )
107112 connection . build_url ( options [ :token_url ] , params ) . to_s
108113 end
109114
110115 # The revoke endpoint URL of the OAuth2 provider
111116 #
112- # @param [Hash] params additional query parameters
117+ # @param [Hash, nil] params additional query parameters
118+ # @return [String] the constructed revoke URL
113119 def revoke_url ( params = nil )
114120 connection . build_url ( options [ :revoke_url ] , params ) . to_s
115121 end
116122
117123 # Makes a request relative to the specified site root.
124+ #
118125 # Updated HTTP 1.1 specification (IETF RFC 7231) relaxed the original constraint (IETF RFC 2616),
119126 # allowing the use of relative URLs in Location headers.
120127 #
121128 # @see https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.2
122129 #
123- # @param [Symbol] verb one of :get, :post, :put, :delete
130+ # @param [Symbol] verb one of [ :get, :post, :put, :delete]
124131 # @param [String] url URL path of request
125132 # @param [Hash] opts the options to make the request with
126133 # @option req_opts [Hash] :params additional query parameters for the URL of the request
@@ -129,9 +136,13 @@ def revoke_url(params = nil)
129136 # @option req_opts [Boolean] :raise_errors whether to raise an OAuth2::Error on 400+ status
130137 # code response for this request. Overrides the client instance setting.
131138 # @option req_opts [Symbol] :parse @see Response::initialize
132- # @option req_opts [true, false ] :snaky (true) @see Response::initialize
139+ # @option req_opts [Boolean ] :snaky (true) @see Response::initialize
133140 #
134- # @yield [req] @see Faraday::Connection#run_request
141+ # @yield [req] The block is passed the request being made, allowing customization
142+ # @yieldparam [Faraday::Request] req The request object that can be modified
143+ # @see Faraday::Connection#run_request
144+ #
145+ # @return [OAuth2::Response] the response from the request
135146 def request ( verb , url , req_opts = { } , &block )
136147 response = execute_request ( verb , url , req_opts , &block )
137148 status = response . status
@@ -532,4 +543,4 @@ def oauth_debug_logging(builder)
532543 builder . response ( :logger , options [ :logger ] , bodies : true ) if OAuth2 ::OAUTH_DEBUG
533544 end
534545 end
535- end
546+ end
0 commit comments