Class: GovFakeNotify::Store
- Inherits:
-
Object
- Object
- GovFakeNotify::Store
- Defined in:
- lib/gov_fake_notify/store.rb
Overview
A central store for storing all state in the app - uses a basic PStore
Class Method Summary collapse
Class Method Details
.clear_attachments!(config: Config.instance) ⇒ Object
23 24 25 |
# File 'lib/gov_fake_notify/store.rb', line 23 def self.(config: Config.instance) FileUtils.rm_rf File.join(config., '.') end |
.clear_messages! ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/gov_fake_notify/store.rb', line 12 def self. instance.transaction do instance.roots.each do |key| next unless key =~ /^message-/ instance.delete(key) end end end |
.instance ⇒ Object
8 9 10 |
# File 'lib/gov_fake_notify/store.rb', line 8 def self.instance Thread.current[:gov_fake_notify_store] ||= ::PStore.new(GovFakeNotify.config.database_file) end |