Class: CanTango::Configuration::System
- Inherits:
-
Registry::Role
show all
- Includes:
- Singleton
- Defined in:
- lib/cantango/roles_ext/configuration/system.rb
Instance Method Summary
collapse
#clear!, #exclude, #excluded, #filter?, #onlies, #only
Instance Method Details
#add_systems(system_apis) ⇒ Object
Also known as:
add_system
24
25
26
27
|
# File 'lib/cantango/roles_ext/configuration/system.rb', line 24
def add_systems system_apis
raise ArgumentError, "Must be a hash fx :troles => :role_list, was: #{system_apis}" if !system_apis.kind_of?(Hash)
self.system_apis.merge! system_apis
end
|
#default_system ⇒ Object
20
21
22
|
# File 'lib/cantango/roles_ext/configuration/system.rb', line 20
def default_system
nil
end
|
#default_system_apis ⇒ Object
38
39
40
|
# File 'lib/cantango/roles_ext/configuration/system.rb', line 38
def default_system_apis
{}
end
|
#system ⇒ Object
16
17
18
|
# File 'lib/cantango/roles_ext/configuration/system.rb', line 16
def system
@system ||= default_system
end
|
#system=(name) ⇒ Object
6
7
8
9
|
# File 'lib/cantango/roles_ext/configuration/system.rb', line 6
def system= name
raise ArgumentError, "Must be a label" if !name.kind_of_label?
@system = name.to_sym
end
|
#system_api ⇒ Object
30
31
32
|
# File 'lib/cantango/roles_ext/configuration/system.rb', line 30
def system_api
system_apis[system] || {}
end
|
#system_apis ⇒ Object
34
35
36
|
# File 'lib/cantango/roles_ext/configuration/system.rb', line 34
def system_apis
@system_apis ||= default_system_apis
end
|
#system_apis=(system_apis) ⇒ Object
11
12
13
14
|
# File 'lib/cantango/roles_ext/configuration/system.rb', line 11
def system_apis= system_apis
raise ArgumentError, "Must be a hash fx :troles => :role_list, was: #{system_apis}" if !system_apis.kind_of?(Hash)
@system_apis = system_apis
end
|