class OauthToken

Public Instance Methods

authorized?() click to toggle source
# File lib/generators/active_record/oauth_provider_templates/oauth_token.rb, line 16
def authorized?
  authorized_at != nil && !invalidated?
end
invalidate!() click to toggle source
# File lib/generators/active_record/oauth_provider_templates/oauth_token.rb, line 12
def invalidate!
  update_attribute(:invalidated_at, Time.now)
end
invalidated?() click to toggle source
# File lib/generators/active_record/oauth_provider_templates/oauth_token.rb, line 8
def invalidated?
  invalidated_at != nil
end
to_query() click to toggle source
# File lib/generators/active_record/oauth_provider_templates/oauth_token.rb, line 20
def to_query
  "oauth_token=#{token}&oauth_token_secret=#{secret}"
end

Protected Instance Methods

generate_keys() click to toggle source
# File lib/generators/active_record/oauth_provider_templates/oauth_token.rb, line 26
def generate_keys
  self.token = OAuth::Helper.generate_key(40)[0,40]
  self.secret = OAuth::Helper.generate_key(40)[0,40]
end