Class: Optimizely::Variation
- Inherits:
-
Object
- Object
- Optimizely::Variation
- Defined in:
- lib/optimizely/variation.rb
Instance Attribute Summary collapse
-
#created ⇒ Object
readonly
Returns the value of attribute created.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#experiment_id ⇒ Object
readonly
Returns the value of attribute experiment_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_paused ⇒ Object
readonly
Returns the value of attribute is_paused.
-
#js_component ⇒ Object
readonly
Returns the value of attribute js_component.
-
#project_id ⇒ Object
readonly
Returns the value of attribute project_id.
-
#section_id ⇒ Object
readonly
Returns the value of attribute section_id.
-
#variation_id ⇒ Object
readonly
Returns the value of attribute variation_id.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
Instance Method Summary collapse
- #[](x) ⇒ Object
-
#initialize(json) ⇒ Variation
constructor
A new instance of Variation.
Constructor Details
#initialize(json) ⇒ Variation
Returns a new instance of Variation.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/optimizely/variation.rb', line 7 def initialize(json) @json = json @is_paused = json['is_paused'] @description = json['description'] @weight = json['weight'] @created = DateTime.parse(json['created']) @variation_id = json['variation_id'] @section_id = json['section_id'] @js_component = json['js_component'] @experiment_id = json['experiment_id'] @project_id = json['project_id'] @id = json['id'] end |
Instance Attribute Details
#created ⇒ Object (readonly)
Returns the value of attribute created.
4 5 6 |
# File 'lib/optimizely/variation.rb', line 4 def created @created end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/optimizely/variation.rb', line 4 def description @description end |
#experiment_id ⇒ Object (readonly)
Returns the value of attribute experiment_id.
4 5 6 |
# File 'lib/optimizely/variation.rb', line 4 def experiment_id @experiment_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/optimizely/variation.rb', line 4 def id @id end |
#is_paused ⇒ Object (readonly)
Returns the value of attribute is_paused.
4 5 6 |
# File 'lib/optimizely/variation.rb', line 4 def is_paused @is_paused end |
#js_component ⇒ Object (readonly)
Returns the value of attribute js_component.
4 5 6 |
# File 'lib/optimizely/variation.rb', line 4 def js_component @js_component end |
#project_id ⇒ Object (readonly)
Returns the value of attribute project_id.
4 5 6 |
# File 'lib/optimizely/variation.rb', line 4 def project_id @project_id end |
#section_id ⇒ Object (readonly)
Returns the value of attribute section_id.
4 5 6 |
# File 'lib/optimizely/variation.rb', line 4 def section_id @section_id end |
#variation_id ⇒ Object (readonly)
Returns the value of attribute variation_id.
4 5 6 |
# File 'lib/optimizely/variation.rb', line 4 def variation_id @variation_id end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
4 5 6 |
# File 'lib/optimizely/variation.rb', line 4 def weight @weight end |
Instance Method Details
#[](x) ⇒ Object
21 22 23 |
# File 'lib/optimizely/variation.rb', line 21 def [](x) return @json[x] end |