Sha256: 244f0c210cb167951269f6cf5a1da8853abae2fae695dc3910c23d41f7ce8516

Contents?: true

Size: 451 Bytes

Versions: 18

Compression:

Stored size: 451 Bytes

Contents

class Baza::Driver::Sqlite3::Databases
  def initialize(args)
    @db = args.fetch(:db)
  end

  def [](name)
    name = name.to_s
    list.each do |database|
      return database if database.name == name
    end

    raise Baza::Errors::DatabaseNotFound
  end

  def list
    ArrayEnumerator.new do |yielder|
      yielder << Baza::Driver::Sqlite3::Database.new(
        name: "Main",
        driver: self,
        db: @db
      )
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
baza-0.0.38 lib/baza/driver/sqlite3/databases.rb
baza-0.0.37 lib/baza/driver/sqlite3/databases.rb
baza-0.0.36 lib/baza/driver/sqlite3/databases.rb
baza-0.0.35 lib/baza/driver/sqlite3/databases.rb
baza-0.0.34 lib/baza/driver/sqlite3/databases.rb
baza-0.0.33 lib/baza/driver/sqlite3/databases.rb
baza-0.0.32 lib/baza/driver/sqlite3/databases.rb
baza-0.0.31 lib/baza/driver/sqlite3/databases.rb
baza-0.0.30 lib/baza/driver/sqlite3/databases.rb
baza-0.0.29 lib/baza/driver/sqlite3/databases.rb
baza-0.0.28 lib/baza/driver/sqlite3/databases.rb
baza-0.0.27 lib/baza/driver/sqlite3/databases.rb
baza-0.0.26 lib/baza/driver/sqlite3/databases.rb
baza-0.0.25 lib/baza/driver/sqlite3/databases.rb
baza-0.0.24 lib/baza/driver/sqlite3/databases.rb
baza-0.0.23 lib/baza/driver/sqlite3/databases.rb
baza-0.0.22 lib/baza/driver/sqlite3/databases.rb
baza-0.0.21 lib/baza/driver/sqlite3/databases.rb