Class: Mutiny::Mutants::Storage
- Inherits:
-
Object
- Object
- Mutiny::Mutants::Storage
- Defined in:
- lib/mutiny/mutants/storage.rb,
lib/mutiny/mutants/storage/path.rb,
lib/mutiny/mutants/storage/file_store.rb,
lib/mutiny/mutants/storage/mutant_file.rb,
lib/mutiny/mutants/storage/mutant_file_name.rb,
lib/mutiny/mutants/storage/mutant_file_contents.rb
Defined Under Namespace
Classes: FileStore, MutantFile, MutantFileContents, MutantFileName, Path
Instance Attribute Summary collapse
-
#store ⇒ Object
Returns the value of attribute store.
Instance Method Summary collapse
-
#initialize(mutant_directory: ".mutants", store: nil) ⇒ Storage
constructor
A new instance of Storage.
- #load_for(subjects) ⇒ Object
- #save(mutants) ⇒ Object
Constructor Details
Instance Attribute Details
#store ⇒ Object
Returns the value of attribute store.
6 7 8 |
# File 'lib/mutiny/mutants/storage.rb', line 6 def store @store end |
Instance Method Details
#load_for(subjects) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/mutiny/mutants/storage.rb', line 16 def load_for(subjects) mutants = store.load_all.map do |mutant_spec| mutant_spec[:subject] = resolve_subject(subjects, **mutant_spec[:subject]) Mutant.new(**mutant_spec) end MutantSet.new(*mutants) end |
#save(mutants) ⇒ Object
12 13 14 |
# File 'lib/mutiny/mutants/storage.rb', line 12 def save(mutants) store.save_all(mutants) end |