Sha256: 80e14b40f160af9538a3c7652a0e6c7f55ff85b24cba06229fef169a9c9ad315

Contents?: true

Size: 588 Bytes

Versions: 8

Compression:

Stored size: 588 Bytes

Contents

# frozen_string_literal: true

require_relative "experiment"

class ContextData
  attr_accessor :experiments

  def initialize(experiments = [])
    @experiments = experiments.map do |experiment|
      Experiment.new(experiment)
    end unless experiments.nil?
    self
  end

  def ==(o)
    return true if self.object_id == o.object_id
    return false if o.nil? || self.class != o.class

    @experiments == o.experiments
  end

  def hash_code
    { name: @name, config: @config }
  end

  def to_s
    "ContextData{" +
      "experiments='" + @experiments.join +
      "}"
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
absmartly-sdk-1.1.2 lib/json/context_data.rb
absmartly-sdk-1.1.1 lib/json/context_data.rb
absmartly-sdk-1.1.0 lib/json/context_data.rb
absmartly-sdk-1.0.8 lib/json/context_data.rb
absmartly-sdk-1.0.7 lib/json/context_data.rb
absmartly-sdk-1.0.6 lib/json/context_data.rb
absmartly-sdk-1.0.5 lib/json/context_data.rb
absmartly-sdk-0.1.2 lib/json/context_data.rb