Class: StatsigEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/statsig_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_name) ⇒ StatsigEvent

Returns a new instance of StatsigEvent.



8
9
10
11
# File 'lib/statsig_event.rb', line 8

def initialize(event_name)
  @event_name = event_name
  @time = Time.now.to_f * 1000
end

Instance Attribute Details

#metadataObject

Returns the value of attribute metadata.



3
4
5
# File 'lib/statsig_event.rb', line 3

def 
  @metadata
end

#secondary_exposuresObject

Returns the value of attribute secondary_exposures.



5
6
7
# File 'lib/statsig_event.rb', line 5

def secondary_exposures
  @secondary_exposures
end

#statsig_metadataObject

Returns the value of attribute statsig_metadata.



4
5
6
# File 'lib/statsig_event.rb', line 4

def 
  @statsig_metadata
end

#userObject

Returns the value of attribute user.



6
7
8
# File 'lib/statsig_event.rb', line 6

def user
  @user
end

#valueObject

Returns the value of attribute value.



2
3
4
# File 'lib/statsig_event.rb', line 2

def value
  @value
end

Instance Method Details

#serializeObject



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/statsig_event.rb', line 19

def serialize
  {
    'eventName' => @event_name,
    'metadata' => @metadata,
    'value' => @value,
    'user' => @user,
    'time' => @time,
    'statsigMetadata' => @statsig_metadata,
    'secondaryExposures' => @secondary_exposures
  }
end