Class: StatsigEvent
- Inherits:
-
Object
- Object
- StatsigEvent
- Defined in:
- lib/statsig_event.rb
Overview
typed: true
Instance Attribute Summary collapse
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#secondary_exposures ⇒ Object
Returns the value of attribute secondary_exposures.
-
#statsig_metadata ⇒ Object
Returns the value of attribute statsig_metadata.
-
#user ⇒ Object
Returns the value of attribute user.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(event_name) ⇒ StatsigEvent
constructor
A new instance of StatsigEvent.
- #serialize ⇒ Object
Constructor Details
#initialize(event_name) ⇒ StatsigEvent
Returns a new instance of StatsigEvent.
9 10 11 12 13 14 15 16 |
# File 'lib/statsig_event.rb', line 9 def initialize(event_name) @event_name = event_name @value = nil @metadata = nil @secondary_exposures = nil @user = nil @time = (Time.now.to_f * 1000).to_i end |
Instance Attribute Details
#metadata ⇒ Object
Returns the value of attribute metadata.
4 5 6 |
# File 'lib/statsig_event.rb', line 4 def @metadata end |
#secondary_exposures ⇒ Object
Returns the value of attribute secondary_exposures.
6 7 8 |
# File 'lib/statsig_event.rb', line 6 def secondary_exposures @secondary_exposures end |
#statsig_metadata ⇒ Object
Returns the value of attribute statsig_metadata.
5 6 7 |
# File 'lib/statsig_event.rb', line 5 def @statsig_metadata end |
#user ⇒ Object
Returns the value of attribute user.
7 8 9 |
# File 'lib/statsig_event.rb', line 7 def user @user end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/statsig_event.rb', line 3 def value @value end |
Instance Method Details
#serialize ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/statsig_event.rb', line 24 def serialize { 'eventName' => @event_name, 'metadata' => @metadata, 'value' => @value, 'user' => @user, 'time' => @time, 'statsigMetadata' => @statsig_metadata, 'secondaryExposures' => @secondary_exposures } end |