Class: Apress::Api::Client

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/apress/api/client.rb

Instance Method Summary collapse

Instance Method Details

#refresh_token_expired?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'app/models/apress/api/client.rb', line 28

def refresh_token_expired?
  refresh_token_expire_at < Time.now.utc
end

#regenerate_tokensObject



16
17
18
19
20
21
# File 'app/models/apress/api/client.rb', line 16

def regenerate_tokens
  generate_secret_token
  set_secret_token_expiration
  generate_refresh_token
  set_refresh_token_expiration
end

#regenerate_tokens!Object



23
24
25
26
# File 'app/models/apress/api/client.rb', line 23

def regenerate_tokens!
  regenerate_tokens
  save!
end

#secret_token_expired?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'app/models/apress/api/client.rb', line 32

def secret_token_expired?
  secret_token_expire_at < Time.now.utc
end