Module: Tacokit::Client::Tokens

Included in:
Tacokit::Client
Defined in:
lib/tacokit/client/tokens.rb

Overview

Methods for the Tokens API

Instance Method Summary collapse

Instance Method Details

#delete_token(token) ⇒ Object

Delete an authorization token

Examples:

Delete an authorization token

Tacokit.delete_token("aToken")

Parameters:

  • token (String)

    the token identifier

See Also:


20
21
22
# File 'lib/tacokit/client/tokens.rb', line 20

def delete_token(token)
  delete token_path(token)
end

#token(token, options = nil) ⇒ Tacokit::Resource

Get an authorization token

Parameters:

  • token (String)

    the token identifier

  • options (Hash) (defaults to: nil)

    options to fetch the token with

Returns:

See Also:


11
12
13
# File 'lib/tacokit/client/tokens.rb', line 11

def token(token, options = nil)
  get token_path(token), options
end

#token_resource(token, resource, *paths) ⇒ Object


25
26
27
28
# File 'lib/tacokit/client/tokens.rb', line 25

def token_resource(token, resource, *paths)
  paths, options = extract_options(camp(resource), *paths)
  get token_path(token, *paths), options
end