Sha256: 7abb36fc7b069ab6964a495be0ba41e3dfb00335d0b7bfe562560ba167bcbfb6

Contents?: true

Size: 645 Bytes

Versions: 28

Compression:

Stored size: 645 Bytes

Contents

class TestTrack::Assignment
  include TestTrack::RequiredOptions

  attr_accessor :context
  attr_reader :visitor, :split_name
  attr_writer :variant

  def initialize(opts = {})
    @visitor = require_option!(opts, :visitor)
    @split_name = require_option!(opts, :split_name).to_s
    raise ArgumentError, "unknown opts: #{opts.keys.to_sentence}" if opts.present?
  end

  def variant
    @variant ||= _variant
  end

  def unsynced?
    true
  end

  private

  def _variant
    return if visitor.offline?
    variant = TestTrack::VariantCalculator.new(visitor: visitor, split_name: split_name).variant
    variant && variant.to_s
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
test_track_rails_client-3.0.1 app/models/test_track/assignment.rb
test_track_rails_client-3.0.0 app/models/test_track/assignment.rb
test_track_rails_client-2.0.0 app/models/test_track/assignment.rb
test_track_rails_client-1.3.0 app/models/test_track/assignment.rb
test_track_rails_client-1.2.0 app/models/test_track/assignment.rb
test_track_rails_client-1.1.0 app/models/test_track/assignment.rb
test_track_rails_client-1.0.0 app/models/test_track/assignment.rb
test_track_rails_client-0.9.20 app/models/test_track/assignment.rb
test_track_rails_client-0.9.19 app/models/test_track/assignment.rb
test_track_rails_client-0.9.18 app/models/test_track/assignment.rb
test_track_rails_client-0.9.17 app/models/test_track/assignment.rb
test_track_rails_client-0.9.16 app/models/test_track/assignment.rb
test_track_rails_client-0.9.15 app/models/test_track/assignment.rb
test_track_rails_client-0.9.14 app/models/test_track/assignment.rb
test_track_rails_client-0.9.13 app/models/test_track/assignment.rb
test_track_rails_client-0.9.12 app/models/test_track/assignment.rb
test_track_rails_client-0.9.11 app/models/test_track/assignment.rb
test_track_rails_client-0.9.10 app/models/test_track/assignment.rb
test_track_rails_client-0.9.9 app/models/test_track/assignment.rb
test_track_rails_client-0.9.8 app/models/test_track/assignment.rb