Class: Baza::Driver::Sqlite3::Databases
- Inherits:
-
Object
- Object
- Baza::Driver::Sqlite3::Databases
- Defined in:
- lib/baza/driver/sqlite3/databases.rb
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(args) ⇒ Databases
constructor
A new instance of Databases.
- #list ⇒ Object
Constructor Details
#initialize(args) ⇒ Databases
Returns a new instance of Databases.
2 3 4 |
# File 'lib/baza/driver/sqlite3/databases.rb', line 2 def initialize(args) @db = args.fetch(:db) end |
Instance Method Details
#[](name) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/baza/driver/sqlite3/databases.rb', line 6 def [](name) name = name.to_s list.each do |database| return database if database.name == name end raise Baza::Errors::DatabaseNotFound end |