Module: Kontena::Cli::Config::TokenSerializer

Included in:
Account, Server
Defined in:
lib/kontena/cli/config.rb

Instance Method Summary collapse

Instance Method Details

#to_h ⇒ Hash

Modified to_h to handle token data serialization

Returns:

  • (Hash)


453
454
455
456
457
458
459
460
461
# File 'lib/kontena/cli/config.rb', line 453

def to_h
  token = delete_field(:token) if respond_to?(:token)
  result = super
  if token
    self.token = token
    result.merge!(token.to_h)
  end
  result
end