Class: TestTrack::JobSession

Inherits:
Object
  • Object
show all
Defined in:
app/models/test_track/job_session.rb

Instance Method Summary collapse

Instance Method Details

#manageObject



2
3
4
5
6
7
8
9
10
11
# File 'app/models/test_track/job_session.rb', line 2

def manage
  raise ArgumentError, "must provide block to `manage`" unless block_given?

  original_job_session = RequestStore[:test_track_job_session]
  RequestStore[:test_track_job_session] = self
  yield
ensure
  notify_unsynced_assignments!
  RequestStore[:test_track_job_session] = original_job_session
end

#visitor_dsl_for(identity) ⇒ Object



13
14
15
16
17
# File 'app/models/test_track/job_session.rb', line 13

def visitor_dsl_for(identity)
  raise "must be called within `manage` block" if RequestStore[:test_track_job_session].nil?

  TestTrack::VisitorDsl.new(for_identity(identity))
end