Sha256: 48fda48454a21a529c45370a75e7718f9d22834d6c05a47505e371fa681203e6
Contents?: true
Size: 1.02 KB
Versions: 55
Compression:
Stored size: 1.02 KB
Contents
module Appfuel module Feature # Loads an action from the container using its fully qualified namespace. # This class has been abstracted out because its Appfuel's implementation # of loading an action. This action loader is injected into the container # during setup which allows the client to use their own if this basic # lookup mehtod does not work for them. # # The idea is that all actions, commands and repositories auto register # themselves into the container based on a namespace derived inpart by # their own ruby namespace. class ActionLoader # @raises RuntimeError when key is not found # @param namespace [String] fully qualifed container namespace # @param container [Dry::Container] application container # @return [Appfuel::Handler::Action] def call(namespace, container) unless container.key?(namespace) fail "[ActionLoader] Could not load action at #{namespace}" end container[namespace] end end end end
Version data entries
55 entries across 55 versions & 1 rubygems