module Rohbau::Registry::ExternalInterface
Public Instance Methods
implementations()
click to toggle source
# File lib/rohbau/registry.rb, line 38 def implementations @implementations ||= Hash.new { |hash, key| hash[key] = [] } end
register(service_name, &constructor)
click to toggle source
# File lib/rohbau/registry.rb, line 16 def register(service_name, &constructor) implementations[service_name] << constructor define_method service_name do cache service_name do instance_eval(&self.class.implementations[service_name].last) end end end
registrations()
click to toggle source
# File lib/rohbau/registry.rb, line 34 def registrations implementations.keys end
unregister(service_name)
click to toggle source
# File lib/rohbau/registry.rb, line 26 def unregister(service_name) implementations[service_name].pop if implementations[service_name].empty? remove_method service_name end end