Class: ContextIO::ConnectToken
- Inherits:
-
Object
- Object
- ContextIO::ConnectToken
- 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
-
#account ⇒ ContextIO::Account?
readonly
The Account associated with this token, if any.
-
#callback_url ⇒ String
readonly
The url that Context.IO will redirect the user to when the account is created.
-
#created_at ⇒ Time
readonly
The time this token was created.
-
#email ⇒ String
readonly
The email address associated with this token.
-
#first_name ⇒ String
readonly
The first name of the owner of the email account associated with this token.
-
#last_name ⇒ String
readonly
The last name of the owner of the email account associated with this token.
-
#service_level ⇒ String
readonly
The Context.IO service level for this account.
-
#token ⇒ String
readonly
The token associated with this connect token.
-
#used ⇒ Boolean
readonly
Whether this token has been used ot not.
Attributes included from API::Resource
#api_attributes, #primary_key, #resource_url
Instance Method Summary collapse
Instance Attribute Details
#account ⇒ ContextIO::Account? (readonly)
Returns The Account associated with this token, if any. Will fetch from the API if necessary.
18 |
# File 'lib/contextio/connect_token.rb', line 18 belongs_to :account |
#callback_url ⇒ String (readonly)
Returns The url that Context.IO will redirect the user to when the account is created. Will fetch from the API if necessary.
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_at ⇒ Time (readonly)
Returns The time this token was created. Will fetch from the API if necessary.
49 50 51 |
# File 'lib/contextio/connect_token.rb', line 49 def created_at @created_at ||= Time.at(created) end |
#email ⇒ String (readonly)
Returns The email address associated with this token. Will fetch from the API if necessary.
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_name ⇒ String (readonly)
Returns The first name of the owner of the email account associated with this token. Will fetch from the API if necessary.
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_name ⇒ String (readonly)
Returns The last name of the owner of the email account associated with this token. Will fetch from the API if necessary.
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_level ⇒ String (readonly)
Returns The Context.IO service level for this account. Will fetch from the API if necessary.
41 42 |
# File 'lib/contextio/connect_token.rb', line 41 lazy_attributes :token, :email, :created, :used, :callback_url, :service_level, :first_name, :last_name |
#token ⇒ String (readonly)
Returns The token associated with this connect token. Will fetch from the API if necessary.
41 42 |
# File 'lib/contextio/connect_token.rb', line 41 lazy_attributes :token, :email, :created, :used, :callback_url, :service_level, :first_name, :last_name |
#used ⇒ Boolean (readonly)
Returns Whether this token has been used ot not. Will fetch from the API if necessary.
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
#delete ⇒ Object
53 54 55 |
# File 'lib/contextio/connect_token.rb', line 53 def delete api.request(:delete, resource_url)['success'] end |