Class: ContextData
- Inherits:
-
Object
- Object
- ContextData
- Defined in:
- lib/json/context_data.rb
Instance Attribute Summary collapse
-
#experiments ⇒ Object
Returns the value of attribute experiments.
Instance Method Summary collapse
- #==(o) ⇒ Object
- #hash_code ⇒ Object
-
#initialize(experiments = []) ⇒ ContextData
constructor
A new instance of ContextData.
- #to_s ⇒ Object
Constructor Details
#initialize(experiments = []) ⇒ ContextData
Returns a new instance of ContextData.
8 9 10 11 12 13 |
# File 'lib/json/context_data.rb', line 8 def initialize(experiments = []) @experiments = experiments.map do |experiment| Experiment.new(experiment) end unless experiments.nil? self end |
Instance Attribute Details
#experiments ⇒ Object
Returns the value of attribute experiments.
6 7 8 |
# File 'lib/json/context_data.rb', line 6 def experiments @experiments end |
Instance Method Details
#==(o) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/json/context_data.rb', line 15 def ==(o) return true if self.object_id == o.object_id return false if o.nil? || self.class != o.class @experiments == o.experiments end |
#hash_code ⇒ Object
22 23 24 |
# File 'lib/json/context_data.rb', line 22 def hash_code { name: @name, config: @config } end |
#to_s ⇒ Object
26 27 28 29 30 |
# File 'lib/json/context_data.rb', line 26 def to_s "ContextData{" + "experiments='" + @experiments.join + "}" end |