Class: CanTango::Configuration::System

Inherits:
Registry::Role show all
Includes:
Singleton
Defined in:
lib/cantango/roles_ext/configuration/system.rb

Direct Known Subclasses

RoleGroups, Roles

Instance Method Summary collapse

Methods inherited from Registry::Role

#clear!, #exclude, #excluded, #filter?, #onlies, #only

Instance Method Details

#add_systems(system_apis) ⇒ Object Also known as: add_system

Raises:

  • (ArgumentError)


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_systemObject



20
21
22
# File 'lib/cantango/roles_ext/configuration/system.rb', line 20

def default_system
  nil
end

#default_system_apisObject



38
39
40
# File 'lib/cantango/roles_ext/configuration/system.rb', line 38

def default_system_apis
  {}
end

#systemObject



16
17
18
# File 'lib/cantango/roles_ext/configuration/system.rb', line 16

def system
  @system ||= default_system
end

#system=(name) ⇒ Object

Raises:

  • (ArgumentError)


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_apiObject



30
31
32
# File 'lib/cantango/roles_ext/configuration/system.rb', line 30

def system_api
  system_apis[system] || {}
end

#system_apisObject



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

Raises:

  • (ArgumentError)


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