class Tenantify::Configuration
It stores a configuration for {Tenantify::Middleware}.
Attributes
strategies[R]
All configured strategies in order of priority.
@return [Array<strategy_config>] a collection of strategy configurations.
Public Class Methods
new()
click to toggle source
Constructor.
# File lib/tenantify/configuration.rb, line 10 def initialize @strategies = [] end
Public Instance Methods
strategy(name_or_class, strategy_config = {})
click to toggle source
Adds a new strategy for the Tenantify
middleware. The order the strategies are added is the priority order they have to match the tenant.
@param [Symbol, Class] the name of a known strategy or a custom strategy
class.
@param [Hash] strategy configuration. @return [Array<strategy_config>] a collection of strategy configurations.
# File lib/tenantify/configuration.rb, line 21 def strategy name_or_class, strategy_config = {} strategies << [name_or_class, strategy_config] end