Module: TwitterAuth::BasicUser

Included in:
GenericUser
Defined in:
app/models/twitter_auth/basic_user.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
9
10
11
# File 'app/models/twitter_auth/basic_user.rb', line 5

def self.included(base)
  base.class_eval do
    attr_protected :crypted_password, :salt
  end

  base.extend TwitterAuth::BasicUser::ClassMethods
end

Instance Method Details

#passwordObject



58
59
60
# File 'app/models/twitter_auth/basic_user.rb', line 58

def password
  TwitterAuth::Cryptify.decrypt(self.crypted_password, self.salt)
end

#password=(new_password) ⇒ Object



52
53
54
55
56
# File 'app/models/twitter_auth/basic_user.rb', line 52

def password=(new_password)
  encrypted = TwitterAuth::Cryptify.encrypt(new_password)
  self.crypted_password = encrypted[:encrypted_data]
  self.salt = encrypted[:salt]
end