Class: Leonidas::App::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/leonidas/app/repository.rb

Instance Method Summary collapse

Instance Method Details

#archive(app) ⇒ Object



28
29
30
31
# File 'lib/leonidas/app/repository.rb', line 28

def archive(app)
	::Leonidas::MemoryLayer::MemoryRegistry.close_app! app.name
	::Leonidas::PersistenceLayer::Persister.persist app
end

#delete(app) ⇒ Object



33
34
35
36
# File 'lib/leonidas/app/repository.rb', line 33

def delete(app)
	::Leonidas::MemoryLayer::MemoryRegistry.close_app! app.name
	::Leonidas::PersistenceLayer::Persister.delete app
end

#find(app_name) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/leonidas/app/repository.rb', line 11

def find(app_name)
	app = ::Leonidas::MemoryLayer::MemoryRegistry.retrieve_app app_name
	if app.nil?
		app = ::Leonidas::PersistenceLayer::Persister.load app_name
		watch app unless app.nil?
	end
	app
end

#save(app) ⇒ Object



24
25
26
# File 'lib/leonidas/app/repository.rb', line 24

def save(app)
	::Leonidas::PersistenceLayer::Persister.persist app
end

#watch(app) ⇒ Object



20
21
22
# File 'lib/leonidas/app/repository.rb', line 20

def watch(app)
	::Leonidas::MemoryLayer::MemoryRegistry.register_app! app
end