Class: Optimizely::Decision

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(campaign_id:, experiment_id:, variation_id:, metadata:) ⇒ Decision

Returns a new instance of Decision.



22
23
24
25
26
27
# File 'lib/optimizely/event/entity/decision.rb', line 22

def initialize(campaign_id:, experiment_id:, variation_id:, metadata:)
  @campaign_id = campaign_id
  @experiment_id = experiment_id
  @variation_id = variation_id
  @metadata = 
end

Instance Attribute Details

#campaign_idObject (readonly)

Returns the value of attribute campaign_id.



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

def campaign_id
  @campaign_id
end

#experiment_idObject (readonly)

Returns the value of attribute experiment_id.



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

def experiment_id
  @experiment_id
end

#metadataObject (readonly)

Returns the value of attribute metadata.



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

def 
  @metadata
end

#variation_idObject (readonly)

Returns the value of attribute variation_id.



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

def variation_id
  @variation_id
end

Instance Method Details

#as_jsonObject



29
30
31
32
33
34
35
36
# File 'lib/optimizely/event/entity/decision.rb', line 29

def as_json
  {
    campaign_id: @campaign_id,
    experiment_id: @experiment_id,
    variation_id: @variation_id,
    metadata: @metadata
  }
end