Class: Zetto::Services::Cookie::SaveSession
- Inherits:
-
Object
- Object
- Zetto::Services::Cookie::SaveSession
- Includes:
- Modules::Crypto
- Defined in:
- lib/zetto/services/cookie/save_session.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(session, cookies) ⇒ SaveSession
constructor
A new instance of SaveSession.
Constructor Details
#initialize(session, cookies) ⇒ SaveSession
Returns a new instance of SaveSession.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/zetto/services/cookie/save_session.rb', line 6 def initialize(session, ) unless session.class.to_s == "Zetto::Storage::Session::Data::Response" raise ArgumentError.new(I18n.t('exseptions.isnt_object', class_name: 'Zetto::Storage::Session::Data::Response')) end unless .class.to_s == "ActionDispatch::Cookies::CookieJar" raise ArgumentError.new(I18n.t('exseptions.save_session_cookies')) end @session = session = end |
Instance Method Details
#execute ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/zetto/services/cookie/save_session.rb', line 18 def execute impuretyData = Zetto::Storage::ImpuretyData::Generate.new.execute ciphered_impurity_hash = generate_hashing(@session.algorithm, impuretyData['impurity_hash']) mixed_hash = get_mix_hashes(@session.session_id, ciphered_impurity_hash, impuretyData['hash_step']) value = (impuretyData, mixed_hash) Zetto::Storage::ImpuretyData::Save.new.execute(impuretyData) value rescue Exception => e Zetto::Services::Info. I18n.t('exseptions.unknown_error', argument: 'Zetto::Services::Cookie::SaveSession', current_method: __method__), e nil end |