Module: Cohabit

Defined in:
lib/cohabit.rb,
lib/cohabit.rb,
lib/cohabit/scope.rb,
lib/cohabit/errors.rb,
lib/cohabit/version.rb,
lib/cohabit/strategy.rb,
lib/cohabit/configuration.rb,
lib/cohabit/route_helper_scope.rb,
lib/cohabit/configuration/scopes.rb,
lib/cohabit/configuration/settings.rb,
lib/cohabit/configuration/strategies.rb,
lib/cohabit/configuration/route_helper_scopes.rb

Defined Under Namespace

Classes: Configuration, Railtie, RouteHelperScope, Scope, Strategy

Constant Summary collapse

Error =
Class.new(RuntimeError)
StrategyNameExistsError =
Class.new(Cohabit::Error)
StrategyNotFoundError =
Class.new(Cohabit::Error)
StrategyNestingError =
Class.new(Cohabit::Error)
InvalidScopeError =
Class.new(Cohabit::Error)
VERSION =
"0.0.2"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.current_tenantObject

Returns the value of attribute current_tenant.



10
11
12
# File 'lib/cohabit.rb', line 10

def current_tenant
  @current_tenant
end

Class Method Details

.add_global(name) ⇒ Object



12
13
14
15
# File 'lib/cohabit.rb', line 12

def add_global(name)
  singleton_class.send(:define_method, name) { @data[name] }
  singleton_class.send(:define_method, "#{name}=") { |val| @data[name] = val }
end