Class: Biblioteque::Engine
- Inherits:
-
Object
- Object
- Biblioteque::Engine
- Defined in:
- lib/biblioteque/engine.rb
Instance Method Summary collapse
- #clone_current(path_destination) ⇒ Object
- #clone_db(path_source, path_destination) ⇒ Object
- #close_db ⇒ Object
- #create_db(name, path) ⇒ Object
- #current_db ⇒ Object
- #current_db_path ⇒ Object
- #delete_db ⇒ Object
-
#initialize ⇒ Engine
constructor
A new instance of Engine.
- #load_db(path) ⇒ Object
Constructor Details
#initialize ⇒ Engine
Returns a new instance of Engine.
4 5 6 7 |
# File 'lib/biblioteque/engine.rb', line 4 def initialize @dbpath = nil @db = nil end |
Instance Method Details
#clone_current(path_destination) ⇒ Object
43 44 45 46 |
# File 'lib/biblioteque/engine.rb', line 43 def clone_current(path_destination) return false unless current_db_path Database.clone(current_db_path, path_destination) end |
#clone_db(path_source, path_destination) ⇒ Object
28 29 30 |
# File 'lib/biblioteque/engine.rb', line 28 def clone_db(path_source, path_destination) Database.clone(path_source, path_destination) end |
#close_db ⇒ Object
32 33 34 35 |
# File 'lib/biblioteque/engine.rb', line 32 def close_db @dbpath = nil @db = nil end |
#create_db(name, path) ⇒ Object
24 25 26 |
# File 'lib/biblioteque/engine.rb', line 24 def create_db(name, path) Database.create(name, path) end |
#current_db ⇒ Object
9 10 11 |
# File 'lib/biblioteque/engine.rb', line 9 def current_db @db end |
#current_db_path ⇒ Object
13 14 15 |
# File 'lib/biblioteque/engine.rb', line 13 def current_db_path @dbpath end |