Class: Crashbreak::SessionRestorer

Inherits:
Object
  • Object
show all
Defined in:
lib/crashbreak/restorers/session_restorer.rb

Instance Method Summary collapse

Constructor Details

#initialize(session_data) ⇒ SessionRestorer

Returns a new instance of SessionRestorer.



3
4
5
# File 'lib/crashbreak/restorers/session_restorer.rb', line 3

def initialize(session_data)
  @session_data = session_data
end

Instance Method Details

#restoreObject



7
8
9
10
11
# File 'lib/crashbreak/restorers/session_restorer.rb', line 7

def restore
  @session_data.tap do |session_data|
    $session_data = session_data # pass it via global variable to restorers middleware
  end
end