Class: Optimizely::VisitorAttribute

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entity_id:, key:, type:, value:) ⇒ VisitorAttribute

Returns a new instance of VisitorAttribute.



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

def initialize(entity_id:, key:, type:, value:)
  @entity_id = entity_id
  @key = key
  @type = type
  @value = value
end

Instance Attribute Details

#entity_idObject (readonly)

Returns the value of attribute entity_id.



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

def entity_id
  @entity_id
end

#keyObject (readonly)

Returns the value of attribute key.



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

def key
  @key
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#as_jsonObject



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

def as_json
  {
    entity_id: @entity_id,
    key: @key,
    type: @type,
    value: @value
  }
end