Class: Penthouse::Tenants::OctopusShardTenant
- Inherits:
-
OctopusSchemaTenant
- Object
- BaseTenant
- SchemaTenant
- OctopusSchemaTenant
- Penthouse::Tenants::OctopusShardTenant
- Defined in:
- lib/penthouse/tenants/octopus_shard_tenant.rb
Instance Attribute Summary collapse
-
#shard ⇒ Object
readonly
Returns the value of attribute shard.
Attributes inherited from SchemaTenant
#default_schema, #persistent_schemas, #tenant_schema
Attributes inherited from BaseTenant
Instance Method Summary collapse
-
#call(&block) {|ShardTenant| ... } ⇒ void
switches to the relevant Octopus shard, and processes the block.
-
#initialize(identifier, shard:, tenant_schema: "public", **options) ⇒ OctopusShardTenant
constructor
A new instance of OctopusShardTenant.
Methods inherited from OctopusSchemaTenant
Methods inherited from SchemaTenant
Methods included from Migratable
Methods inherited from BaseTenant
Constructor Details
#initialize(identifier, shard:, tenant_schema: "public", **options) ⇒ OctopusShardTenant
Returns a new instance of OctopusShardTenant.
21 22 23 24 |
# File 'lib/penthouse/tenants/octopus_shard_tenant.rb', line 21 def initialize(identifier, shard:, tenant_schema: "public", **) self.shard = shard super(identifier, tenant_schema: tenant_schema, **) end |
Instance Attribute Details
#shard ⇒ Object
Returns the value of attribute shard.
15 16 17 |
# File 'lib/penthouse/tenants/octopus_shard_tenant.rb', line 15 def shard @shard end |
Instance Method Details
#call(&block) {|ShardTenant| ... } ⇒ void
This method returns an undefined value.
switches to the relevant Octopus shard, and processes the block
30 31 32 |
# File 'lib/penthouse/tenants/octopus_shard_tenant.rb', line 30 def call(&block) super(shard: shard, &block) end |