Method: Kontena::Cli::Config::Token#to_h

Defined in:
lib/kontena/cli/config.rb

#to_hHash

Hash representation of token data

Returns:

  • (Hash)


619
620
621
622
623
624
625
# File 'lib/kontena/cli/config.rb', line 619

def to_h
  {
    token: self.access_token,
    token_expires_at: self.expires_at,
    refresh_token: self.refresh_token
  }.merge(self.respond_to?(:username) ? {username: self.username} : {})
end