lib/nurse/shared_service_factory.rb in nurse-rb-2.0.0 vs lib/nurse/shared_service_factory.rb in nurse-rb-2.1.0
- old
+ new
@@ -1,9 +1,15 @@
module Nurse
class SharedServiceFactory < ServiceFactory
- def attach_to(dependency_manager)
- dependency_manager.share(dependency_key) do |di|
- create_service(di)
+ def shared?
+ true
+ end
+
+ class << self
+ private
+
+ def share(_shared)
+ raise 'You cannot change the shared state of a shared service factory. Extend Nurse::ServiceFactory instead'
end
end
end
end