Skip to content

Commit da2c2dd

Browse files
committed
rename expiration
1 parent a308b45 commit da2c2dd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

custom_templates/configuration.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ module {{moduleName}}
174174
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
175175
{{#authMethods}}
176176
{{#isOAuth}}
177-
@access_token_expires_at = nil
177+
@access_token_expiration = nil
178178
@access_token_getter = Proc.new {
179-
access_token_valid = @access_token && (@access_token_expires_at.nil? || @access_token_expires_at > Time.now + 60)
179+
access_token_valid = @access_token && (@access_token_expiration.nil? || @access_token_expiration > Time.now + 60)
180180
next @access_token if access_token_valid
181181
next unless @client_id && @client_secret
182182
@@ -198,7 +198,7 @@ module {{moduleName}}
198198
end
199199
body = JSON.parse(response.body)
200200
@access_token = body['access_token']
201-
@access_token_expires_at = Time.now + body['expires_in']
201+
@access_token_expiration = Time.now + body['expires_in']
202202
}
203203
{{/isOAuth}}
204204
{{/authMethods}}

lib/bandwidth-sdk/configuration.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ def initialize
192192
@inject_format = false
193193
@force_ending_format = false
194194
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
195-
@access_token_expires_at = nil
195+
@access_token_expiration = nil
196196
@access_token_getter = Proc.new {
197-
access_token_valid = @access_token && (@access_token_expires_at.nil? || @access_token_expires_at > Time.now + 60)
197+
access_token_valid = @access_token && (@access_token_expiration.nil? || @access_token_expiration > Time.now + 60)
198198
next @access_token if access_token_valid
199199
next unless @client_id && @client_secret
200200

@@ -216,7 +216,7 @@ def initialize
216216
end
217217
body = JSON.parse(response.body)
218218
@access_token = body['access_token']
219-
@access_token_expires_at = Time.now + body['expires_in']
219+
@access_token_expiration = Time.now + body['expires_in']
220220
}
221221

222222
yield(self) if block_given?

0 commit comments

Comments
 (0)