Class: Mengpaneel::Replayer

Inherits:
Object
  • Object
show all
Defined in:
lib/mengpaneel/replayer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(manager) ⇒ Replayer

Returns a new instance of Replayer.


7
8
9
# File 'lib/mengpaneel/replayer.rb', line 7

def initialize(manager)
  @manager = manager
end

Instance Attribute Details

#managerObject (readonly)

Returns the value of attribute manager


5
6
7
# File 'lib/mengpaneel/replayer.rb', line 5

def manager
  @manager
end

Instance Method Details

#runObject


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/mengpaneel/replayer.rb', line 11

def run
  return unless manager.controller
  
  delayed_calls = Delayer.new(manager.controller).load!

  Manager::MODES.each do |mode|
    next unless delayed_calls.has_key?(mode)

    calls = delayed_calls[mode] || []

    manager.send(mode) do
      replay_calls(calls)
    end
  end
end