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.7.0 lib/appfuel/root_module.rb
appfuel-0.6.16 lib/appfuel/root_module.rb
appfuel-0.6.15 lib/appfuel/root_module.rb
appfuel-0.6.14 lib/appfuel/root_module.rb
appfuel-0.6.13 lib/appfuel/root_module.rb
appfuel-0.6.12 lib/appfuel/root_module.rb
appfuel-0.6.11 lib/appfuel/root_module.rb
appfuel-0.6.10 lib/appfuel/root_module.rb
appfuel-0.6.9 lib/appfuel/root_module.rb
appfuel-0.6.8 lib/appfuel/root_module.rb
appfuel-0.6.7 lib/appfuel/root_module.rb
appfuel-0.6.6 lib/appfuel/root_module.rb
appfuel-0.6.5 lib/appfuel/root_module.rb
appfuel-0.6.4 lib/appfuel/root_module.rb
appfuel-0.6.3 lib/appfuel/root_module.rb
appfuel-0.6.1 lib/appfuel/root_module.rb
appfuel-0.5.16 lib/appfuel/root_module.rb
appfuel-0.5.15 lib/appfuel/root_module.rb
appfuel-0.5.14 lib/appfuel/root_module.rb
appfuel-0.5.13 lib/appfuel/root_module.rb