class Qa::Authorities::Local::Registry

Attributes

logger[W]

Public Class Methods

logger() click to toggle source
# File lib/qa/authorities/local/registry.rb, line 21
def self.logger
  @logger ||= ::Rails.logger if defined? Rails && Rails.respond_to?(:logger)
end
new() { |self| ... } click to toggle source
# File lib/qa/authorities/local/registry.rb, line 4
def initialize
  @hash = {}
  yield self if block_given?
end

Public Instance Methods

add(subauthority, class_name) click to toggle source
# File lib/qa/authorities/local/registry.rb, line 29
def add(subauthority, class_name)
  Registry.logger.debug "Registering Local QA authority: #{subauthority} - #{class_name}"
  @hash[subauthority] = RegistryEntry.new(subauthority, class_name)
end
fetch(key) click to toggle source
# File lib/qa/authorities/local/registry.rb, line 17
def fetch(key)
  @hash.fetch(key)
end
instance_for(key) click to toggle source
# File lib/qa/authorities/local/registry.rb, line 13
def instance_for(key)
  fetch(key).instance
end
keys() click to toggle source
# File lib/qa/authorities/local/registry.rb, line 9
def keys
  @hash.keys
end