Class: MM::Repository
- Inherits:
-
Object
- Object
- MM::Repository
- Defined in:
- lib/mm/repository.rb
Constant Summary collapse
- FILE_NAME =
'.mm_pstore'
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
Instance Method Details
#[](key) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/mm/repository.rb', line 24 def [](key) return nil unless File.exist?(FILE_NAME) repository = PStore.new(FILE_NAME) repository.transaction(true) do repository[key] end end |
#[]=(key, value) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/mm/repository.rb', line 33 def []=(key, value) repository = PStore.new(FILE_NAME) repository.transaction do repository[key] = value end end |