Class: ContextIO::ConnectToken

Inherits:
Object
  • Object
show all
Includes:
API::Resource
Defined in:
lib/contextio/connect_token.rb

Overview

Represents a single connect token for an account. You can use this to inspect or delete the token. Most of the attributes are lazily loaded, meaning that the API won't get hit until you ask for an attribute the object doesn't already have (presumably from a previous API call).

Instance Attribute Summary collapse

Attributes included from API::Resource

#api_attributes, #primary_key, #resource_url

Instance Method Summary collapse

Instance Attribute Details

#accountContextIO::Account? (readonly)



18
# File 'lib/contextio/connect_token.rb', line 18

belongs_to :account

#callback_urlString (readonly)



41
42
# File 'lib/contextio/connect_token.rb', line 41

lazy_attributes :token, :email, :created, :used, :callback_url,
:service_level, :first_name, :last_name

#created_atTime (readonly)



49
50
51
# File 'lib/contextio/connect_token.rb', line 49

def created_at
  @created_at ||= Time.at(created)
end

#emailString (readonly)



41
42
# File 'lib/contextio/connect_token.rb', line 41

lazy_attributes :token, :email, :created, :used, :callback_url,
:service_level, :first_name, :last_name

#first_nameString (readonly)



41
42
# File 'lib/contextio/connect_token.rb', line 41

lazy_attributes :token, :email, :created, :used, :callback_url,
:service_level, :first_name, :last_name

#last_nameString (readonly)



41
42
# File 'lib/contextio/connect_token.rb', line 41

lazy_attributes :token, :email, :created, :used, :callback_url,
:service_level, :first_name, :last_name

#service_levelString (readonly)



41
42
# File 'lib/contextio/connect_token.rb', line 41

lazy_attributes :token, :email, :created, :used, :callback_url,
:service_level, :first_name, :last_name

#tokenString (readonly)



41
42
# File 'lib/contextio/connect_token.rb', line 41

lazy_attributes :token, :email, :created, :used, :callback_url,
:service_level, :first_name, :last_name

#usedBoolean (readonly)



41
42
# File 'lib/contextio/connect_token.rb', line 41

lazy_attributes :token, :email, :created, :used, :callback_url,
:service_level, :first_name, :last_name

Instance Method Details

#deleteObject



53
54
55
# File 'lib/contextio/connect_token.rb', line 53

def delete
  api.request(:delete, resource_url)['success']
end