Class: Verdict::Storage::MockStorage

Inherits:
Object
  • Object
show all
Defined in:
lib/verdict/storage/mock_storage.rb

Instance Method Summary collapse

Instance Method Details

#clear_experiment(experiment) ⇒ Object

Should clear out the storage used for this experiment



25
26
# File 'lib/verdict/storage/mock_storage.rb', line 25

def clear_experiment(experiment)
end

#remove_assignment(experiment, subject_identifier) ⇒ Object

Should remove the subject from storage, so it will be reassigned later.



21
22
# File 'lib/verdict/storage/mock_storage.rb', line 21

def remove_assignment(experiment, subject_identifier)
end

#retrieve_assignment(experiment, subject_identifier) ⇒ Object

Should do a fast lookup of an assignment of the subject for the given experiment.

  • Should return nil if not found in store

  • Should return an Assignment instance otherwise.



16
17
18
# File 'lib/verdict/storage/mock_storage.rb', line 16

def retrieve_assignment(experiment, subject_identifier)
  nil
end

#retrieve_start_timestamp(experiment) ⇒ Object

Retrieves the start timestamp of the experiment



29
30
31
# File 'lib/verdict/storage/mock_storage.rb', line 29

def retrieve_start_timestamp(experiment)
  nil
end

#store_assignment(assignment) ⇒ Object

Should store the assignments to allow quick lookups.

  • Assignments should be unique on the combination of ‘assignment.experiment.handle` and `assignment.subject_identifier`.

  • The main property to store is ‘group.handle`

  • Should return true if stored successfully.



9
10
11
# File 'lib/verdict/storage/mock_storage.rb', line 9

def store_assignment(assignment)
  false
end

#store_start_timestamp(experiment, timestamp) ⇒ Object

Stores the timestamp on which the experiment was started



34
35
# File 'lib/verdict/storage/mock_storage.rb', line 34

def store_start_timestamp(experiment, timestamp)
end