Class: Devise::SecretKeyFinder
- Inherits:
-
Object
- Object
- Devise::SecretKeyFinder
- Defined in:
- lib/devise/secret_key_finder.rb
Instance Method Summary collapse
- #find ⇒ Object
-
#initialize(application) ⇒ SecretKeyFinder
constructor
A new instance of SecretKeyFinder.
Constructor Details
#initialize(application) ⇒ SecretKeyFinder
Returns a new instance of SecretKeyFinder.
5 6 7 |
# File 'lib/devise/secret_key_finder.rb', line 5 def initialize(application) @application = application end |
Instance Method Details
#find ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/devise/secret_key_finder.rb', line 9 def find if @application.respond_to?(:credentials) && key_exists?(@application.credentials) @application.credentials.secret_key_base elsif @application.respond_to?(:secrets) && key_exists?(@application.secrets) @application.secrets.secret_key_base elsif @application.config.respond_to?(:secret_key_base) && key_exists?(@application.config) @application.config.secret_key_base end end |