Sha256: 32957f86cd536a948f7f17df57af26c654fe45c8f82c6db70fa586445b76d9e2

Contents?: true

Size: 765 Bytes

Versions: 55

Compression:

Stored size: 765 Bytes

Contents

module Appfuel
  # The root module is an import concept. It represents the services top most
  # namespace. It is assumed that the root module will have a feature module,
  # its child, and that feature module will have many action classes inside it.
  module RootModule

    def root_module=(value)
      fail "Root module must be a module" unless value.is_a?(Module)
      @root_module = value
    end

    def root_module
      @root_module ||= root_module_const
    end

    protected

    def root_module_const
      name = root_module_name
      unless Kernel.const_defined?(name)
        fail "Root module is not defined (#{name})"
      end

      Kernel.const_get(name)
    end

    def root_module_name
      self.to_s.split("::").first
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
appfuel-0.3.3 lib/appfuel/root_module.rb
appfuel-0.3.2 lib/appfuel/root_module.rb
appfuel-0.3.1 lib/appfuel/root_module.rb
appfuel-0.3.0 lib/appfuel/root_module.rb
appfuel-0.2.11 lib/appfuel/root_module.rb
appfuel-0.2.10 lib/appfuel/root_module.rb
appfuel-0.2.9 lib/appfuel/root_module.rb
appfuel-0.2.8 lib/appfuel/root_module.rb
appfuel-0.2.7 lib/appfuel/root_module.rb
appfuel-0.2.6 lib/appfuel/root_module.rb
appfuel-0.2.5 lib/appfuel/root_module.rb
appfuel-0.2.4 lib/appfuel/root_module.rb
appfuel-0.2.3 lib/appfuel/root_module.rb
appfuel-0.2.2.pre.alpha.pre.140 lib/appfuel/root_module.rb
appfuel-0.2.0 lib/appfuel/root_module.rb