Module: Qa::Authorities::Local

Extended by:
AuthorityWithSubAuthority, LocalSubauthority
Defined in:
lib/qa/authorities/local.rb

Defined Under Namespace

Classes: FileBasedAuthority, Registry

Class Method Summary collapse

Methods included from AuthorityWithSubAuthority

new, subauthorities, subauthority_class, subauthority_for, validate_subauthority!

Methods included from LocalSubauthority

names, subauthorities_path

Class Method Details

.register_subauthority(subauthority, class_name) ⇒ Object



22
23
24
# File 'lib/qa/authorities/local.rb', line 22

def self.register_subauthority(subauthority, class_name)
  registry.add(subauthority, class_name)
end

.registryObject



13
14
15
16
17
18
19
# File 'lib/qa/authorities/local.rb', line 13

def self.registry
  @registry ||= begin
    Registry.new do |reg|
      register_defaults(reg)
    end
  end
end

.subauthoritiesObject



26
27
28
# File 'lib/qa/authorities/local.rb', line 26

def self.subauthorities
  registry.keys
end

.subauthority_for(subauthority) ⇒ Object



8
9
10
11
# File 'lib/qa/authorities/local.rb', line 8

def self.subauthority_for(subauthority)
  validate_subauthority!(subauthority)
  registry.instance_for(subauthority)
end