Class: CanTango::Config
- Inherits:
-
Object
show all
- Extended by:
- ClassMethods
- Includes:
- Singleton
- Defined in:
- lib/cantango/config.rb,
lib/cantango/config/orms.rb,
lib/cantango/config/user.rb,
lib/cantango/config/debug.rb,
lib/cantango/config/guest.rb,
lib/cantango/config/hooks.rb,
lib/cantango/config/users.rb,
lib/cantango/config/models.rb,
lib/cantango/config/ability.rb,
lib/cantango/config/account.rb,
lib/cantango/config/engines.rb,
lib/cantango/config/factory.rb,
lib/cantango/config/helpers.rb,
lib/cantango/config/accounts.rb,
lib/cantango/config/adapters.rb,
lib/cantango/config/autoload.rb,
lib/cantango/config/categories.rb,
lib/cantango/config/localhosts.rb,
lib/cantango/config/ability/modes.rb,
lib/cantango/config/class_methods.rb,
lib/cantango/config/engines/order.rb,
lib/cantango/config/ability/engine.rb,
lib/cantango/config/ability/modes/execution.rb
Defined Under Namespace
Modules: ClassMethods, Factory
Classes: Ability, Account, Accounts, Adapters, Autoload, Categories, Debug, Engines, Guest, Helpers, Hooks, Localhosts, Models, Orms, User, Users
Instance Method Summary
collapse
components, extended
Instance Method Details
#ability ⇒ Object
28
29
30
31
32
|
# File 'lib/cantango/config.rb', line 28
def ability
@ability ||= CanTango::Config::Ability.instance
@ability.default_class ||= CanTango::Ability::Executor::Modal @ability
end
|
#clear! ⇒ Object
44
45
46
47
48
49
50
51
52
|
# File 'lib/cantango/config.rb', line 44
def clear!
CanTango::Configuration.components.each do |component|
if respond_to? component
component = send(component)
component.send(:clear!) if component.respond_to? :clear!
end
end
engines.clear!
end
|
#debug! ⇒ Object
34
35
36
|
# File 'lib/cantango/config.rb', line 34
def debug!
debug.on!
end
|
#default_settings! ⇒ Object
Turn on default engines and enable compile adapter i.e compilation of rules via sourcify
40
41
42
|
# File 'lib/cantango/config.rb', line 40
def default_settings!
engines.all :off
end
|