Class: ExperimentVariant

Inherits:
Object
  • Object
show all
Defined in:
lib/json/experiment_variant.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = nil, config) ⇒ ExperimentVariant

Returns a new instance of ExperimentVariant.



6
7
8
9
# File 'lib/json/experiment_variant.rb', line 6

def initialize(name = nil, config)
  @name = name
  @config = config
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



4
5
6
# File 'lib/json/experiment_variant.rb', line 4

def config
  @config
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/json/experiment_variant.rb', line 4

def name
  @name
end

Instance Method Details

#==(o) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/json/experiment_variant.rb', line 11

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

  that = o
  @name == that.name && @config == that.config
end

#hash_codeObject



19
20
21
# File 'lib/json/experiment_variant.rb', line 19

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

#to_sObject



23
24
25
26
27
28
# File 'lib/json/experiment_variant.rb', line 23

def to_s
  "ExperimentVariant{" +
    "name='#{@name}'" +
    ", config='#{@config}'" +
    "}"
end