Class Authtoken
In: app/models/authtoken.rb
Parent: ActiveRecord::Base

Methods

Public Class methods

[Source]

   # File app/models/authtoken.rb, line 7
7:     def self.consumer
8:       raise "This class must be extended and consumer defined"
9:     end

[Source]

    # File app/models/authtoken.rb, line 19
19:     def self.establish_auth_token(username, request_token)
20:       access_token        = request_token.get_access_token
21:       auth_token          = Authtoken.new
22:       auth_token.username = username
23:       auth_token.token    = access_token.token
24:       auth_token.secret   = access_token.secret
25:       auth_token.save!
26:     end

[Source]

    # File app/models/authtoken.rb, line 11
11:     def self.new_request_token
12:       begin
13:         self.consumer.get_request_token
14:       rescue Exception => e
15:         logger.error("Unable to get consumer request token [#{e}]")
16:       end
17:     end

Public Instance methods

[Source]

    # File app/models/authtoken.rb, line 28
28:     def to_access_token
29:       OAuth::AccessToken.new(self.consumer, self.token, self.secret)
30:     end

[Validate]