Class: Optimizely::EventContext

Inherits:
Object
  • Object
show all
Defined in:
lib/optimizely/event/entity/event_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_id:, project_id:, anonymize_ip:, revision:, client_name:, client_version:) ⇒ EventContext

Returns a new instance of EventContext.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/optimizely/event/entity/event_context.rb', line 23

def initialize(
  account_id:,
  project_id:,
  anonymize_ip:,
  revision:,
  client_name:,
  client_version:
)
  @account_id = 
  @project_id = project_id
  @anonymize_ip = anonymize_ip
  @revision = revision
  @client_name = client_name
  @client_version = client_version
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



20
21
22
# File 'lib/optimizely/event/entity/event_context.rb', line 20

def 
  @account_id
end

#anonymize_ipObject (readonly)

Returns the value of attribute anonymize_ip.



20
21
22
# File 'lib/optimizely/event/entity/event_context.rb', line 20

def anonymize_ip
  @anonymize_ip
end

#client_nameObject (readonly)

Returns the value of attribute client_name.



20
21
22
# File 'lib/optimizely/event/entity/event_context.rb', line 20

def client_name
  @client_name
end

#client_versionObject (readonly)

Returns the value of attribute client_version.



20
21
22
# File 'lib/optimizely/event/entity/event_context.rb', line 20

def client_version
  @client_version
end

#project_idObject (readonly)

Returns the value of attribute project_id.



20
21
22
# File 'lib/optimizely/event/entity/event_context.rb', line 20

def project_id
  @project_id
end

#revisionObject (readonly)

Returns the value of attribute revision.



20
21
22
# File 'lib/optimizely/event/entity/event_context.rb', line 20

def revision
  @revision
end

Instance Method Details

#as_jsonObject



39
40
41
42
43
44
45
46
47
48
# File 'lib/optimizely/event/entity/event_context.rb', line 39

def as_json
  {
    account_id: @account_id,
    project_id: @project_id,
    anonymize_ip: @anonymize_ip,
    revision: @revision,
    client_name: @client_name,
    client_version: @client_version
  }
end