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.



6
7
8
9
10
11
12
13
14
# File 'lib/statsig_event.rb', line 6

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
  @statsig_metadata = Statsig.
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.



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

def secondary_exposures
  @secondary_exposures
end

#statsig_metadataObject

Returns the value of attribute statsig_metadata.



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

def 
  @statsig_metadata
end

#userObject

Returns the value of attribute user.



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

def user
  @user
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#serializeObject



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