Sha256: be37a518a92b38659fd050b01bf881cde016e255be9a6e2058d7a01121147f0c

Contents?: true

Size: 544 Bytes

Versions: 20

Compression:

Stored size: 544 Bytes

Contents

module OptimizelyServerSide
  class Variation

    # Class holding meta data about variation.
    # content: The block / content of the variation
    # Primary: If this is the primary variation. Primary is
    # applicable in the cases of fallback / test is paused.

    attr_reader :primary, :key

    def initialize(primary: false, content: nil, key: nil)
      @primary = primary
      @key     = key
      @content = content
    end

    # Content is a block. Call is calling that block.
    def call
      @content.call
    end

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
optimizely_server_side-2.0.1 lib/optimizely_server_side/variation.rb
optimizely_server_side-2.0.0 lib/optimizely_server_side/variation.rb
optimizely_server_side-1.2.2 lib/optimizely_server_side/variation.rb
optimizely_server_side-1.2.1 lib/optimizely_server_side/variation.rb
optimizely_server_side-1.2.0 lib/optimizely_server_side/variation.rb
optimizely_server_side-1.0.1 lib/optimizely_server_side/variation.rb
optimizely_server_side-1.0.0 lib/optimizely_server_side/variation.rb
optimizely_server_side-0.0.18 lib/optimizely_server_side/variation.rb
optimizely_server_side-0.0.17 lib/optimizely_server_side/variation.rb
optimizely_server_side-0.0.16 lib/optimizely_server_side/variation.rb
optimizely_server_side-0.0.15 lib/optimizely_server_side/variation.rb
optimizely_server_side-0.0.14 lib/optimizely_server_side/variation.rb
optimizely_server_side-0.0.13 lib/optimizely_server_side/variation.rb
optimizely_server_side-0.0.12 lib/optimizely_server_side/variation.rb
optimizely_server_side-0.0.11 lib/optimizely_server_side/variation.rb
optimizely_server_side-0.0.10 lib/optimizely_server_side/variation.rb
optimizely_server_side-0.0.9 lib/optimizely_server_side/variation.rb
optimizely_server_side-0.0.8 lib/optimizely_server_side/variation.rb
optimizely_server_side-0.0.7 lib/optimizely_server_side/variation.rb
optimizely_server_side-0.0.6 lib/optimizely_server_side/variation.rb