Class: Zetto::Services::Cookie::FindSession
- Inherits:
-
Object
- Object
- Zetto::Services::Cookie::FindSession
- Includes:
- Modules::Crypto
- Defined in:
- lib/zetto/services/cookie/find_session.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(cookies) ⇒ FindSession
constructor
A new instance of FindSession.
Constructor Details
#initialize(cookies) ⇒ FindSession
Returns a new instance of FindSession.
6 7 8 9 10 11 |
# File 'lib/zetto/services/cookie/find_session.rb', line 6 def initialize() unless .class.to_s == "ActionDispatch::Cookies::CookieJar" raise ArgumentError.new(I18n.t('exseptions.need_cookie')) end @cookies = end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/zetto/services/cookie/find_session.rb', line 13 def execute token_data = if token_data.present? get_session_from_db(token_data) end rescue Exception => e Zetto::Services::Info. I18n.t('exseptions.unknown_error', argument: 'Zetto::Services::Cookie::FindSession', current_method: __method__), e nil end |