Class: Hackle::UserEvent
- Inherits:
-
Object
- Object
- Hackle::UserEvent
- Defined in:
- lib/hackle/internal/event/user_event.rb
Direct Known Subclasses
Instance Attribute Summary collapse
- #insert_id ⇒ String readonly
- #timestamp ⇒ Integer readonly
- #user ⇒ HackleUser readonly
Class Method Summary collapse
- .exposure(evaluation, properties, user, timestamp) ⇒ Hackle::ExposureEvent
- .remote_config(evaluation, properties, user, timestamp) ⇒ Hackle::RemoteConfigEvent
- .track(event_type, event, user, timestamp) ⇒ Hackle::TrackEvent
Instance Method Summary collapse
-
#initialize(insert_id:, timestamp:, user:) ⇒ UserEvent
constructor
A new instance of UserEvent.
Constructor Details
#initialize(insert_id:, timestamp:, user:) ⇒ UserEvent
Returns a new instance of UserEvent.
20 21 22 23 24 |
# File 'lib/hackle/internal/event/user_event.rb', line 20 def initialize(insert_id:, timestamp:, user:) @insert_id = insert_id @timestamp = @user = user end |
Instance Attribute Details
#insert_id ⇒ String (readonly)
9 10 11 |
# File 'lib/hackle/internal/event/user_event.rb', line 9 def insert_id @insert_id end |
#timestamp ⇒ Integer (readonly)
12 13 14 |
# File 'lib/hackle/internal/event/user_event.rb', line 12 def @timestamp end |
#user ⇒ HackleUser (readonly)
15 16 17 |
# File 'lib/hackle/internal/event/user_event.rb', line 15 def user @user end |
Class Method Details
.exposure(evaluation, properties, user, timestamp) ⇒ Hackle::ExposureEvent
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/hackle/internal/event/user_event.rb', line 33 def exposure(evaluation, properties, user, ) ExposureEvent.new( insert_id: SecureRandom.uuid, timestamp: , user: user, experiment: evaluation.experiment, variation_id: evaluation.variation_id, variation_key: evaluation.variation_key, decision_reason: evaluation.reason, properties: properties ) end |
.remote_config(evaluation, properties, user, timestamp) ⇒ Hackle::RemoteConfigEvent
66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/hackle/internal/event/user_event.rb', line 66 def remote_config(evaluation, properties, user, ) RemoteConfigEvent.new( insert_id: SecureRandom.uuid, timestamp: , user: user, parameter: evaluation.parameter, value_id: evaluation.value_id, decision_reason: evaluation.reason, properties: properties ) end |
.track(event_type, event, user, timestamp) ⇒ Hackle::TrackEvent
51 52 53 54 55 56 57 58 59 |
# File 'lib/hackle/internal/event/user_event.rb', line 51 def track(event_type, event, user, ) TrackEvent.new( insert_id: SecureRandom.uuid, timestamp: , user: user, event_type: event_type, event: event ) end |