Sha256: 9e655c9af18c1e6bd9baa5bb75b01dcebbaa8bc59ff36cad3bf923d77c0624a0

Contents?: true

Size: 672 Bytes

Versions: 26

Compression:

Stored size: 672 Bytes

Contents

class TestTrack::Fake::Visitor
  attr_reader :id

  Assignment = Struct.new(:split_name, :variant, :unsynced, :context)

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

  def self.reset!
    @instance = nil
  end

  def initialize(id)
    @id = id
  end

  def assignments
    @assignments ||= _assignments
  end

  def split_registry
    TestTrack::Fake::SplitRegistry.instance.to_h
  end

  private

  def _assignments
    split_registry.keys.map do |split_name|
      variant = TestTrack::VariantCalculator.new(visitor: self, split_name: split_name).variant
      Assignment.new(split_name, variant, false, "the_context")
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
test_track_rails_client-4.0.0.alpha26 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha25 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha24 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha23 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha22 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha21 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha20 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha19 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha18 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha17 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha16 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha15 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha14 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha13 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha12 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha11 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha10 app/models/test_track/fake/visitor.rb
test_track_rails_client-4.0.0.alpha9 app/models/test_track/fake/visitor.rb
test_track_rails_client-3.0.1 app/models/test_track/fake/visitor.rb
test_track_rails_client-3.0.0 app/models/test_track/fake/visitor.rb