Module: Spider::App

Defined in:
lib/spiderfw/app.rb

Overview

The Spider::App module must be included in each apps’ main module inside the apps’s _init.rb file.

Example: apps/my_app/_init.rb

module MyApp
    include Spider::App
end

It extends the including module, defining several variables and Class methods. All variables are pre-set to defaults, but can be overridden by the including Module (see ClassMethods).

The app’s module can implement several lifecycle hooks (as Module methods):

  • app_init: called during the framework’s init phase

  • app_startup: called when a server is started

  • app_shutdown: called when a server is shut down

Defined Under Namespace

Modules: AppClass, ClassMethods Classes: AppSpec, RuntimeSort

Class Method Summary collapse

Class Method Details

.included(mod) ⇒ Object



409
410
411
412
413
414
415
416
417
418
419
# File 'lib/spiderfw/app.rb', line 409

def self.included(mod)
    mod.module_eval do
        
        include Spider::DataTypes
        
        extend ClassMethods
    end

    mod.init()
    Spider::add_app(mod)
end