Class: TestTrack::Fake::Visitor

Inherits:
Object
  • Object
show all
Defined in:
app/models/test_track/fake/visitor.rb

Defined Under Namespace

Classes: Assignment

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ Visitor

Returns a new instance of Visitor.



15
16
17
# File 'app/models/test_track/fake/visitor.rb', line 15

def initialize(id)
  @id = id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



2
3
4
# File 'app/models/test_track/fake/visitor.rb', line 2

def id
  @id
end

Class Method Details

.instanceObject



6
7
8
# File 'app/models/test_track/fake/visitor.rb', line 6

def self.instance
  @instance ||= new(TestTrack::FakeServer.seed)
end

.reset!Object



10
11
12
13
# File 'app/models/test_track/fake/visitor.rb', line 10

def self.reset!
  @instance = nil
  TestTrack::Fake::SplitRegistry.reset!
end

Instance Method Details

#assignmentsObject



19
20
21
# File 'app/models/test_track/fake/visitor.rb', line 19

def assignments
  @assignments ||= _assignments
end

#split_registryObject



23
24
25
# File 'app/models/test_track/fake/visitor.rb', line 23

def split_registry
  TestTrack::SplitRegistry.new(TestTrack::Fake::SplitRegistry.instance.to_h)
end