Class: Authn::TokenField::Finders::BaseEncrypted
- Inherits:
-
Object
- Object
- Authn::TokenField::Finders::BaseEncrypted
- Defined in:
- lib/authn/token_field/finders/base_encrypted.rb
Direct Known Subclasses
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(strategy, token, unscoped) ⇒ BaseEncrypted
constructor
A new instance of BaseEncrypted.
Constructor Details
#initialize(strategy, token, unscoped) ⇒ BaseEncrypted
Returns a new instance of BaseEncrypted.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/authn/token_field/finders/base_encrypted.rb', line 7 def initialize(strategy, token, unscoped) unless strategy.is_a?(::Authn::TokenField::Encrypted) raise ArgumentError, 'Please provide an encrypted strategy.' end @strategy = strategy @token = token @unscoped = unscoped end |
Instance Method Details
#execute ⇒ Object
18 19 20 |
# File 'lib/authn/token_field/finders/base_encrypted.rb', line 18 def execute base_scope.find_by(encrypted_field => tokens) # rubocop:disable CodeReuse/ActiveRecord -- have to use find_by end |