Module: Multitenant::Mysql

Defined in:
lib/multitenant-mysql/db.rb,
lib/multitenant-mysql/errors.rb,
lib/multitenant-mysql/configs.rb,
lib/multitenant-mysql/version.rb,
lib/multitenant-mysql/configs/base.rb,
lib/multitenant-mysql/configs/bucket.rb,
lib/multitenant-mysql/connection_switcher.rb

Defined Under Namespace

Modules: Configs Classes: ConnectionSwitcher, DB, InvalidBucketError, InvalidBucketFieldError, InvalidConfigsError, InvalidTenantError, NoTenantRegistratedError, Tenant

Constant Summary collapse

VERSION =
"1.2.2"

Class Method Summary collapse

Class Method Details

.configsObject


18
19
20
# File 'lib/multitenant-mysql/configs.rb', line 18

def configs
  @configs
end

.configs=(configs) ⇒ Object


14
15
16
# File 'lib/multitenant-mysql/configs.rb', line 14

def configs=configs
  @configs = configs
end

.configure(&block) ⇒ Object


7
8
9
10
11
12
# File 'lib/multitenant-mysql/configs.rb', line 7

def configure &block
  raise InvalidConfigsError.new('Multitenant::Mysql: No configs provided') unless block_given?
  configs = Configs::Base.new
  block.call(configs)
  self.configs = configs
end