class Laboratory::Adapters::MockAdapter
Attributes
experiment_hash[RW]
Public Class Methods
new()
click to toggle source
# File lib/laboratory/adapters/mock_adapter.rb, line 6 def initialize @experiment_hash = {} end
Public Instance Methods
delete(experiment_id)
click to toggle source
# File lib/laboratory/adapters/mock_adapter.rb, line 22 def delete(experiment_id) experiment_hash.delete(experiment_id) end
delete_all()
click to toggle source
# File lib/laboratory/adapters/mock_adapter.rb, line 26 def delete_all @experiment_hash = {} end
read(experiment_id)
click to toggle source
# File lib/laboratory/adapters/mock_adapter.rb, line 18 def read(experiment_id) experiment_hash[experiment_id] end
read_all()
click to toggle source
# File lib/laboratory/adapters/mock_adapter.rb, line 14 def read_all experiment_hash.values end
write(experiment)
click to toggle source
# File lib/laboratory/adapters/mock_adapter.rb, line 10 def write(experiment) experiment_hash[experiment.id] = experiment end