Class: Penthouse::Runners::BaseRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/penthouse/runners/base_runner.rb

Direct Known Subclasses

SchemaRunner

Class Method Summary collapse

Class Method Details

.call(tenant_identifier, &block) ⇒ void

This method returns an undefined value.

Parameters:

  • tenant_identifier (String, Symbol)

    The identifier for the tenant

  • block (Block)

    The code to execute within the tenant

Raises:



18
19
20
21
22
23
24
# File 'lib/penthouse/runners/base_runner.rb', line 18

def self.call(tenant_identifier, &block)
  load_tenant(tenant_identifier).call do |tenant|
    Penthouse.with_tenant(tenant.identifier) do
      block.yield(tenant)
    end
  end
end

.load_tenant(tenant_identifier) ⇒ Penthouse::Tenants::BaseTenant

This method is abstract.

returns the tenant object

Returns An instance of a tenant.

Parameters:

  • tenant_identifier (String, Symbol)

    The identifier for the tenant

Returns:

Raises:



30
31
32
# File 'lib/penthouse/runners/base_runner.rb', line 30

def self.load_tenant(tenant_identifier)
  raise NotImplementedError
end