Class: Penthouse::Tenants::BaseTenant

Inherits:
Object
  • Object
show all
Defined in:
lib/penthouse/tenants/base_tenant.rb

Direct Known Subclasses

SchemaTenant

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(identifier) ⇒ BaseTenant

Returns a new instance of BaseTenant.

Parameters:

  • identifier (String, Symbol)

    An identifier for the tenant



17
18
19
# File 'lib/penthouse/tenants/base_tenant.rb', line 17

def initialize(identifier)
  self.identifier = identifier
end

Instance Attribute Details

#identifierObject

Returns the value of attribute identifier.



13
14
15
# File 'lib/penthouse/tenants/base_tenant.rb', line 13

def identifier
  @identifier
end

Instance Method Details

#call(&block) {|BaseTenant| ... } ⇒ void

This method is abstract.

placeholder for the relevant tenant-switching code

This method returns an undefined value.

Parameters:

  • block (Block)

    The code to execute within the tenant

Yields:

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/penthouse/tenants/base_tenant.rb', line 25

def call(&block)
  raise NotImplementedError
end

#createvoid

This method is abstract.

creates the tenant data store

This method returns an undefined value.

Raises:

  • (NotImplementedError)


31
32
33
# File 'lib/penthouse/tenants/base_tenant.rb', line 31

def create(*)
  raise NotImplementedError
end

#deletevoid

This method is abstract.

deletes the tenant data store

This method returns an undefined value.

Raises:

  • (NotImplementedError)


37
38
39
# File 'lib/penthouse/tenants/base_tenant.rb', line 37

def delete(*)
  raise NotImplementedError
end