class Qa::Authorities::Local::Registry
Attributes
Public Class Methods
Source
# File lib/qa/authorities/local/registry.rb, line 21 def self.logger @logger ||= ::Rails.logger if defined? Rails && Rails.respond_to?(:logger) end
Source
# File lib/qa/authorities/local/registry.rb, line 4 def initialize @hash = {} yield self if block_given? end
Public Instance Methods
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
Source
# File lib/qa/authorities/local/registry.rb, line 17 def fetch(key) @hash.fetch(key) end
Source
# File lib/qa/authorities/local/registry.rb, line 13 def instance_for(key) fetch(key).instance end