Class: TestTrack::AnalyticsEvent
- Inherits:
-
Object
- Object
- TestTrack::AnalyticsEvent
- Defined in:
- app/models/test_track/analytics_event.rb
Instance Attribute Summary collapse
-
#assignment ⇒ Object
readonly
Returns the value of attribute assignment.
-
#visitor_id ⇒ Object
readonly
Returns the value of attribute visitor_id.
Instance Method Summary collapse
-
#initialize(visitor_id, assignment) ⇒ AnalyticsEvent
constructor
A new instance of AnalyticsEvent.
- #name ⇒ Object
- #properties ⇒ Object
Constructor Details
#initialize(visitor_id, assignment) ⇒ AnalyticsEvent
Returns a new instance of AnalyticsEvent.
5 6 7 8 |
# File 'app/models/test_track/analytics_event.rb', line 5 def initialize(visitor_id, assignment) @visitor_id = visitor_id @assignment = assignment end |
Instance Attribute Details
#assignment ⇒ Object (readonly)
Returns the value of attribute assignment.
3 4 5 |
# File 'app/models/test_track/analytics_event.rb', line 3 def assignment @assignment end |
#visitor_id ⇒ Object (readonly)
Returns the value of attribute visitor_id.
3 4 5 |
# File 'app/models/test_track/analytics_event.rb', line 3 def visitor_id @visitor_id end |
Instance Method Details
#name ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/models/test_track/analytics_event.rb', line 10 def name if assignment.feature_gate? 'feature_gate_experienced' else 'split_assigned' end end |
#properties ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'app/models/test_track/analytics_event.rb', line 18 def properties { test_track_visitor_id: visitor_id, split_name: assignment.split_name, split_variant: assignment.variant, split_context: assignment.context } end |