Class: Crabfarm::Live::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/crabfarm/live/controller.rb

Instance Method Summary collapse

Constructor Details

#initialize(_manager) ⇒ Controller

Returns a new instance of Controller.



9
10
11
# File 'lib/crabfarm/live/controller.rb', line 9

def initialize(_manager)
  @manager = _manager
end

Instance Method Details

#display_external_error(_exc) ⇒ Object



13
14
15
16
# File 'lib/crabfarm/live/controller.rb', line 13

def display_external_error(_exc)
  @manager.reset_driver_status
  display_error_feedback _exc
end

#execute_live(_class) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/crabfarm/live/controller.rb', line 18

def execute_live(_class)
  begin
    runner = build_runner_for _class
    prepare_session_for runner
    runner.execute
  rescue Exception => exc
    display_error_feedback exc
  ensure
    clean_up_session
  end
end