Class: Chain::AccessToken::ClientModule

Inherits:
ClientModule show all
Defined in:
lib/chain/access_token.rb

Defined Under Namespace

Classes: Query

Instance Attribute Summary

Attributes inherited from ClientModule

#client

Instance Method Summary collapse

Methods inherited from ClientModule

#initialize

Constructor Details

This class inherits a constructor from Chain::ClientModule

Instance Method Details

#create(opts = {}) ⇒ AccessToken

Create an access token.

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :id (String)

    ID specifying the ID of newly created access token. You must specify a unique ID for access token.

  • :type (String)

    DEPRECATED. Do not use in 1.2 or greater.

Returns:



37
38
39
# File 'lib/chain/access_token.rb', line 37

def create(opts = {})
  AccessToken.new(client.conn.request('create-access-token', opts))
end

#delete(id) ⇒ void

This method returns an undefined value.

Delete the access token specified.

Parameters:

  • id (String)

    access token ID

Raises:



54
55
56
57
# File 'lib/chain/access_token.rb', line 54

def delete(id)
  client.conn.request('delete-access-token', {id: id})
  nil
end

#query(opts = {}) ⇒ Query

Get all access tokens sorted by descending creation time, optionally filtered by type.

Parameters:

  • opts (Hash) (defaults to: {})

    Filtering information

Options Hash (opts):

  • :type (String)

    DEPRECATED. Do not use in 1.2 or greater.

Returns:



46
47
48
# File 'lib/chain/access_token.rb', line 46

def query(opts = {})
  Query.new(client, opts)
end