Class: TestTrack::ThreadedVisitorNotifier
- Inherits:
-
Object
- Object
- TestTrack::ThreadedVisitorNotifier
- Defined in:
- app/models/test_track/threaded_visitor_notifier.rb
Instance Attribute Summary collapse
-
#visitor ⇒ Object
readonly
Returns the value of attribute visitor.
Instance Method Summary collapse
-
#initialize(visitor) ⇒ ThreadedVisitorNotifier
constructor
A new instance of ThreadedVisitorNotifier.
- #notify ⇒ Object
Constructor Details
#initialize(visitor) ⇒ ThreadedVisitorNotifier
Returns a new instance of ThreadedVisitorNotifier.
4 5 6 |
# File 'app/models/test_track/threaded_visitor_notifier.rb', line 4 def initialize(visitor) @visitor = visitor end |
Instance Attribute Details
#visitor ⇒ Object (readonly)
Returns the value of attribute visitor.
2 3 4 |
# File 'app/models/test_track/threaded_visitor_notifier.rb', line 2 def visitor @visitor end |
Instance Method Details
#notify ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/models/test_track/threaded_visitor_notifier.rb', line 8 def notify payload = { visitor_id: visitor.id, assignments: visitor.unsynced_assignments } ActiveSupport::Notifications.instrument('test_track.notify_unsynced_assignments', payload) do new_thread_with_request_store do TestTrack::UnsyncedAssignmentsNotifier.new(payload).notify end end end |