Class: PlaywrightOnRails::TracksResets

Inherits:
Object
  • Object
show all
Defined in:
lib/playwright-on-rails/tracks_resets.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.instanceObject



5
6
7
# File 'lib/playwright-on-rails/tracks_resets.rb', line 5

def self.instance
  @instance ||= new
end

Instance Method Details

#reset_needed!Object



9
10
11
# File 'lib/playwright-on-rails/tracks_resets.rb', line 9

def reset_needed!
  @reset_needed = true
end

#reset_state_if_needed(transactional_server) ⇒ Object



13
14
15
16
17
18
# File 'lib/playwright-on-rails/tracks_resets.rb', line 13

def reset_state_if_needed(transactional_server)
  if @reset_needed
    ResetsState.new.call(transactional_server: transactional_server)
    @reset_needed = false
  end
end