struct Twitch::Config::Token

Included Modules

Defined in:

twitch/config/token.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.generate(username : String, token_path : String, scope : Set(String), client_id : String, client_secret : String, force_new_code : Bool = false) : Token #

[View source]
def self.new(access_token : String, refresh_token : String, expires_at : Time, scope : Set(String), token_type : String) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]
def self.refresh(username : String, token_path : String, client_id : String, client_secret : String, old_token : Token) : Token #

[View source]
def self.save(username : String, token_path : String, token : Token) : Token #

[View source]

Class Method Detail

def self.load(username : String, token_path : String) : Token | Nil #

[View source]

Instance Method Detail

def access_token : String #

def clone #

[View source]
def copy_with(access_token _access_token = @access_token, refresh_token _refresh_token = @refresh_token, expires_at _expires_at = @expires_at, scope _scope = @scope, token_type _token_type = @token_type) #

[View source]
def expires_at : Time #

def refresh_token : String #

def scope : Set(String) #

def token_type : String #