Class: Optimizely::Visitor

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(snapshots:, visitor_id:, attributes:) ⇒ Visitor

Returns a new instance of Visitor.



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

def initialize(snapshots:, visitor_id:, attributes:)
  @snapshots = snapshots
  @visitor_id = visitor_id
  @attributes = attributes
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

#snapshotsObject (readonly)

Returns the value of attribute snapshots.



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

def snapshots
  @snapshots
end

#visitor_idObject (readonly)

Returns the value of attribute visitor_id.



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

def visitor_id
  @visitor_id
end

Instance Method Details

#as_jsonObject



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

def as_json
  {
    snapshots: @snapshots,
    visitor_id: @visitor_id,
    attributes: @attributes
  }
end