Sha256: 1285a080ec7e13acae30f1dd648471380f3eafa76191bf08dacc2f2d158eb03f
Contents?: true
Size: 1.18 KB
Versions: 1
Compression:
Stored size: 1.18 KB
Contents
# # This class provides an abstract for the tenant interface. Whilst any Proc # could be used, it's safest for people to sub-class to ensure that any future # interface changes are catered for. # # A tenant class's responsibility is to receive a block, around which it should # handle switching to the given tenant's configuration, ensuring that if an # exception occurs, the configuration is reset back to the global configuration. # module Penthouse module Tenants class BaseTenant attr_accessor :identifier private :identifier= # @param identifier [String, Symbol] An identifier for the tenant def initialize(identifier) self.identifier = identifier end # @abstract placeholder for the relevant tenant-switching code # @param block [Block] The code to execute within the tenant # @yield [BaseTenant] The current tenant instance def call(&block) raise NotImplementedError end # @abstract creates the tenant data store def create(*) raise NotImplementedError end # @abstract deletes the tenant data store def delete(*) raise NotImplementedError end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
penthouse-0.3.0 | lib/penthouse/tenants/base_tenant.rb |