Class: Mailtrap::ApiToken

Inherits:
Struct
  • Object
show all
Defined in:
lib/mailtrap/api_token.rb

Overview

Data Transfer Object for API Token

Instance Attribute Summary collapse

Instance Attribute Details

#created_byString (readonly)

Name of the user or token that created this token

Returns:

  • (String)

    the current value of created_by



12
13
14
# File 'lib/mailtrap/api_token.rb', line 12

def created_by
  @created_by
end

#expires_atString? (readonly)

When the token expires (ISO 8601); nil if it does not expire

Returns:

  • (String, nil)

    the current value of expires_at



12
13
14
# File 'lib/mailtrap/api_token.rb', line 12

def expires_at
  @expires_at
end

#idInteger (readonly)

The API token ID

Returns:

  • (Integer)

    the current value of id



12
13
14
# File 'lib/mailtrap/api_token.rb', line 12

def id
  @id
end

#last_4_digitsString (readonly)

Last 4 characters of the token

Returns:

  • (String)

    the current value of last_4_digits



12
13
14
# File 'lib/mailtrap/api_token.rb', line 12

def last_4_digits
  @last_4_digits
end

#nameString (readonly)

Token display name

Returns:

  • (String)

    the current value of name



12
13
14
# File 'lib/mailtrap/api_token.rb', line 12

def name
  @name
end

#resourcesArray<Hash> (readonly)

Permissions granted to this token

Returns:

  • (Array<Hash>)

    the current value of resources



12
13
14
# File 'lib/mailtrap/api_token.rb', line 12

def resources
  @resources
end

#tokenString? (readonly)

Full token value — only populated by #create and #reset

Returns:

  • (String, nil)

    the current value of token



12
13
14
# File 'lib/mailtrap/api_token.rb', line 12

def token
  @token
end