Skip to content

Commit dcab107

Browse files
chore: order client variables by "importance" (#98)
1 parent 93128b8 commit dcab107

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

lib/finch_api/client.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ class Client < FinchAPI::Transport::BaseClient
8282

8383
# Creates and returns a new client for interacting with the API.
8484
#
85-
# @param base_url [String, nil] Override the default base URL for the API, e.g., `"https://api.example.com/v2/"`
86-
#
87-
# @param access_token [String, nil]
88-
#
8985
# @param client_id [String, nil] Defaults to `ENV["FINCH_CLIENT_ID"]`
9086
#
9187
# @param client_secret [String, nil] Defaults to `ENV["FINCH_CLIENT_SECRET"]`
9288
#
89+
# @param access_token [String, nil]
90+
#
91+
# @param base_url [String, nil] Override the default base URL for the API, e.g., `"https://api.example.com/v2/"`
92+
#
9393
# @param max_retries [Integer] Max number of retries to attempt after a failed retryable request.
9494
#
9595
# @param timeout [Float]
@@ -98,10 +98,10 @@ class Client < FinchAPI::Transport::BaseClient
9898
#
9999
# @param max_retry_delay [Float]
100100
def initialize(
101-
base_url: nil,
102-
access_token: nil,
103101
client_id: ENV["FINCH_CLIENT_ID"],
104102
client_secret: ENV["FINCH_CLIENT_SECRET"],
103+
access_token: nil,
104+
base_url: nil,
105105
max_retries: DEFAULT_MAX_RETRIES,
106106
timeout: DEFAULT_TIMEOUT_IN_SECONDS,
107107
initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY,
@@ -113,9 +113,9 @@ def initialize(
113113
"finch-api-version" => "2020-09-17"
114114
}
115115

116-
@access_token = access_token&.to_s
117116
@client_id = client_id&.to_s
118117
@client_secret = client_secret&.to_s
118+
@access_token = access_token&.to_s
119119

120120
super(
121121
base_url: base_url,

rbi/lib/finch_api/client.rbi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ module FinchAPI
6767
# Creates and returns a new client for interacting with the API.
6868
sig do
6969
params(
70-
base_url: T.nilable(String),
71-
access_token: T.nilable(String),
7270
client_id: T.nilable(String),
7371
client_secret: T.nilable(String),
72+
access_token: T.nilable(String),
73+
base_url: T.nilable(String),
7474
max_retries: Integer,
7575
timeout: Float,
7676
initial_retry_delay: Float,
@@ -79,13 +79,13 @@ module FinchAPI
7979
.returns(T.attached_class)
8080
end
8181
def self.new(
82-
# Override the default base URL for the API, e.g., `"https://api.example.com/v2/"`
83-
base_url: nil,
84-
access_token: nil,
8582
# Defaults to `ENV["FINCH_CLIENT_ID"]`
8683
client_id: ENV["FINCH_CLIENT_ID"],
8784
# Defaults to `ENV["FINCH_CLIENT_SECRET"]`
8885
client_secret: ENV["FINCH_CLIENT_SECRET"],
86+
access_token: nil,
87+
# Override the default base URL for the API, e.g., `"https://api.example.com/v2/"`
88+
base_url: nil,
8989
# Max number of retries to attempt after a failed retryable request.
9090
max_retries: DEFAULT_MAX_RETRIES,
9191
timeout: DEFAULT_TIMEOUT_IN_SECONDS,

sig/finch_api/client.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ module FinchAPI
4141
private def basic_auth: -> ::Hash[String, String]
4242

4343
def initialize: (
44-
?base_url: String?,
45-
?access_token: String?,
4644
?client_id: String?,
4745
?client_secret: String?,
46+
?access_token: String?,
47+
?base_url: String?,
4848
?max_retries: Integer,
4949
?timeout: Float,
5050
?initial_retry_delay: Float,

0 commit comments

Comments
 (0)