Class: Absurdity::Variant

Inherits:
Object
  • Object
show all
Defined in:
lib/absurdity/variant.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(slug, experiment_slug, identity_id) ⇒ Variant

Returns a new instance of Variant.



9
10
11
12
13
# File 'lib/absurdity/variant.rb', line 9

def initialize(slug, experiment_slug, identity_id)
  @slug            = slug
  @experiment_slug = experiment_slug
  @identity_id     = identity_id
end

Instance Attribute Details

#experiment_slugObject (readonly)

Returns the value of attribute experiment_slug.



8
9
10
# File 'lib/absurdity/variant.rb', line 8

def experiment_slug
  @experiment_slug
end

#identity_idObject (readonly)

Returns the value of attribute identity_id.



8
9
10
# File 'lib/absurdity/variant.rb', line 8

def identity_id
  @identity_id
end

#slugObject (readonly)

Returns the value of attribute slug.



8
9
10
# File 'lib/absurdity/variant.rb', line 8

def slug
  @slug
end

Class Method Details

.find(identity_id, experiment_slug) ⇒ Object



4
5
6
# File 'lib/absurdity/variant.rb', line 4

def self.find(identity_id, experiment_slug)
  Datastore.find(self, experiment_slug: experiment_slug, identity_id: identity_id)
end

Instance Method Details

#saveObject



15
16
17
# File 'lib/absurdity/variant.rb', line 15

def save
  Datastore.save(self)
end