Class: Prismic::Experiment
- Inherits:
-
Object
- Object
- Prismic::Experiment
- Defined in:
- lib/prismic/experiments.rb
Instance Attribute Summary collapse
- #google_id ⇒ String readonly
- #id ⇒ String readonly
- #name ⇒ String readonly
- #variations ⇒ Array<Variation> readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, google_id, name, variations) ⇒ Experiment
constructor
A new instance of Experiment.
Constructor Details
#initialize(id, google_id, name, variations) ⇒ Experiment
Returns a new instance of Experiment
64 65 66 67 68 69 |
# File 'lib/prismic/experiments.rb', line 64 def initialize(id, google_id, name, variations) @id = id @google_id = google_id @name = name @variations = variations end |
Instance Attribute Details
#google_id ⇒ String (readonly)
58 59 60 |
# File 'lib/prismic/experiments.rb', line 58 def google_id @google_id end |
#id ⇒ String (readonly)
56 57 58 |
# File 'lib/prismic/experiments.rb', line 56 def id @id end |
#name ⇒ String (readonly)
60 61 62 |
# File 'lib/prismic/experiments.rb', line 60 def name @name end |
#variations ⇒ Array<Variation> (readonly)
62 63 64 |
# File 'lib/prismic/experiments.rb', line 62 def variations @variations end |
Class Method Details
.parse(data) ⇒ Experiment
72 73 74 75 76 |
# File 'lib/prismic/experiments.rb', line 72 def self.parse(data) new(data['id'], data['googleId'], data['name'], data['variations'].map { |variation| Variation.parse(variation) }) end |