Sha256: e178e22f4e4e955885ff88d5850026019cacb288dc357a823496d70c1bbb166b

Contents?: true

Size: 830 Bytes

Versions: 3

Compression:

Stored size: 830 Bytes

Contents

module Appfuel
  module Application
    module ContainerClassRegistration
      # All handlers are automatically registered into the application
      # container which allows them to easily be retrieved for execution.
      # The ContainerKey mixin handles converting ruby class namespaces to
      # container key, so we simply need to obtain the qualified namespace
      # key for this class extending this, that does not belong to appfuel.
      #
      # @param klass [Class] the handler class that is inheriting this
      # @return [Boolean]
      def register_container_class(klass)
        root = klass.container_root_name
        return false if root == 'appfuel'

        container = Appfuel.app_container(root)
        container.register(klass.container_qualified_key, klass)
        true
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
appfuel-0.2.3 lib/appfuel/application/container_class_registration.rb
appfuel-0.2.2.pre.alpha.pre.140 lib/appfuel/application/container_class_registration.rb
appfuel-0.2.0 lib/appfuel/application/container_class_registration.rb