Class: Prismic::Variation

Inherits:
Object
  • Object
show all
Defined in:
lib/prismic/experiments.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, ref, label) ⇒ Variation

Returns a new instance of Variation.



87
88
89
90
91
# File 'lib/prismic/experiments.rb', line 87

def initialize(id, ref, label)
  @id = id
  @ref = ref
  @label = label
end

Instance Attribute Details

#idString (readonly)

Returns:

  • (String)


81
82
83
# File 'lib/prismic/experiments.rb', line 81

def id
  @id
end

#labelString (readonly)

Returns:

  • (String)


85
86
87
# File 'lib/prismic/experiments.rb', line 85

def label
  @label
end

#refString (readonly)

Returns:

  • (String)


83
84
85
# File 'lib/prismic/experiments.rb', line 83

def ref
  @ref
end

Class Method Details

.parse(data) ⇒ Variation

Returns:



94
95
96
# File 'lib/prismic/experiments.rb', line 94

def self.parse(data)
  new(data['id'], data['ref'], data['label'])
end