Class: OauthToken
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- OauthToken
show all
- Includes:
- Mongoid::Document, Mongoid::Timestamps
- Defined in:
- lib/generators/mongoid/oauth_provider_templates/oauth_token.rb,
lib/generators/active_record/oauth_provider_templates/oauth_token.rb
Instance Method Summary
collapse
Instance Method Details
#authorized? ⇒ Boolean
31
32
33
|
# File 'lib/generators/mongoid/oauth_provider_templates/oauth_token.rb', line 31
def authorized?
!authorized_at.nil? && !invalidated?
end
|
#invalidate! ⇒ Object
27
28
29
|
# File 'lib/generators/mongoid/oauth_provider_templates/oauth_token.rb', line 27
def invalidate!
update_attribute(:invalidated_at, Time.now)
end
|
#invalidated? ⇒ Boolean
23
24
25
|
# File 'lib/generators/mongoid/oauth_provider_templates/oauth_token.rb', line 23
def invalidated?
!invalidated_at.nil?
end
|
#to_query ⇒ Object
35
36
37
|
# File 'lib/generators/mongoid/oauth_provider_templates/oauth_token.rb', line 35
def to_query
"oauth_token=#{token}&oauth_token_secret=#{secret}"
end
|