Class: Cabal::API::User
- Inherits:
-
Ohm::Model
- Object
- Ohm::Model
- Cabal::API::User
- Includes:
- Ohm::Callbacks
- Defined in:
- lib/cabal/api/user.rb
Instance Attribute Summary collapse
-
#secret_key ⇒ Object
The secret key should not be saved plain, but we want to access it immediately after creation.
Instance Method Summary collapse
Instance Attribute Details
#secret_key ⇒ Object
The secret key should not be saved plain, but we want to access it immediately after creation
13 14 15 |
# File 'lib/cabal/api/user.rb', line 13 def secret_key @secret_key end |
Instance Method Details
#authenticated_with?(secret_key) ⇒ Boolean
32 33 34 35 36 |
# File 'lib/cabal/api/user.rb', line 32 def authenticated_with?(secret_key) return false unless crypted_secret_key BCrypt::Password.new(crypted_secret_key) == secret_key end |
#before_create ⇒ Object
27 28 29 30 |
# File 'lib/cabal/api/user.rb', line 27 def before_create set_access_key set_secret_key end |